File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -157,6 +157,11 @@ def get_args():
157157 action = "store_true" ,
158158 help = "Run cambricon test" ,
159159 )
160+ parser .add_argument (
161+ "--ali" ,
162+ action = "store_true" ,
163+ help = "Run alippu test" ,
164+ )
160165 parser .add_argument (
161166 "--model" ,
162167 type = str ,
@@ -351,6 +356,8 @@ def run(
351356 device_str = "cuda"
352357 elif args .cambricon :
353358 device_str = "mlu"
359+ elif args .ali :
360+ device_str = "cuda"
354361 else :
355362 print (
356363 "python examples/bench.py --nvidia --model=~/TinyLlama-1.1B-Chat-v1.0/ --batch-size=2 --tp=1 --input-len=50 --output-len=50"
Original file line number Diff line number Diff line change @@ -47,6 +47,11 @@ def get_args():
4747 action = "store_true" ,
4848 help = "Run cambricon test" ,
4949 )
50+ parser .add_argument (
51+ "--ali" ,
52+ action = "store_true" ,
53+ help = "Run alippu test" ,
54+ )
5055 parser .add_argument (
5156 "--model_path" ,
5257 type = str ,
@@ -252,9 +257,11 @@ def test(
252257 device_str = "cuda"
253258 elif args .cambricon :
254259 device_str = "mlu"
260+ elif args .ali :
261+ device_str = "cuda"
255262 else :
256263 print (
257- "Usage: python examples/jiuge.py [--cpu | --nvidia | --metax | --moore | --iluvatar] --model_path=<path/to/model_dir>\n "
264+ "Usage: python examples/jiuge.py [--cpu | --nvidia | --metax | --moore | --iluvatar | --cambricon | --ali ] --model_path=<path/to/model_dir>\n "
258265 "such as, python examples/jiuge.py --nvidia --model_path=~/TinyLlama-1.1B-Chat-v1.0"
259266 )
260267 sys .exit (1 )
Original file line number Diff line number Diff line change @@ -414,6 +414,7 @@ def parse_args():
414414 parser .add_argument ("--moore" , action = "store_true" , help = "Use Moore device" )
415415 parser .add_argument ("--iluvatar" , action = "store_true" , help = "Use Iluvatar device" )
416416 parser .add_argument ("--cambricon" , action = "store_true" , help = "Use Cambricon device" )
417+ parser .add_argument ("--ali" , action = "store_true" , help = "Use Ali PPU device" )
417418 parser .add_argument (
418419 "--enable-graph" ,
419420 action = "store_true" ,
@@ -447,9 +448,11 @@ def main():
447448 device = "cuda"
448449 elif args .cambricon :
449450 device = "mlu"
451+ elif args .ali :
452+ device = "cuda"
450453 else :
451454 print (
452- "Usage: python infinilm.server.inference_server [--cpu | --nvidia | --metax | --moore | --iluvatar | --cambricon] "
455+ "Usage: python infinilm.server.inference_server [--cpu | --nvidia | --metax | --moore | --iluvatar | --cambricon | --ali ] "
453456 "--model_path=<path/to/model_dir> --max_tokens=MAX_TOKENS --max_batch_size=MAX_BATCH_SIZE"
454457 "\n "
455458 "Example: python infinilm.server.inference_server --nvidia --model_path=/data/shared/models/9G7B_MHA/ "
Original file line number Diff line number Diff line change @@ -860,9 +860,11 @@ def test():
860860 device_type = DeviceType .DEVICE_TYPE_KUNLUN
861861 elif sys .argv [1 ] == "--hygon" :
862862 device_type = DeviceType .DEVICE_TYPE_HYGON
863+ elif sys .argv [1 ] == "--ali" :
864+ device_type = DeviceType .DEVICE_TYPE_ALI
863865 else :
864866 print (
865- "Usage: python jiuge.py [--cpu | --nvidia| --qy| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon] <path/to/model_dir> [n_device] [--verbose]"
867+ "Usage: python jiuge.py [--cpu | --nvidia| --qy| --cambricon | --ascend | --metax | --moore | --iluvatar | --kunlun | --hygon | --ali ] <path/to/model_dir> [n_device] [--verbose]"
866868 )
867869 sys .exit (1 )
868870
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ class DeviceType(ctypes.c_int):
3737 DEVICE_TYPE_KUNLUN = 7
3838 DEVICE_TYPE_HYGON = 8
3939 DEVICE_TYPE_QY = 9
40+ DEVICE_TYPE_ALI = 10
4041
4142
4243class KVCacheCStruct (ctypes .Structure ):
You can’t perform that action at this time.
0 commit comments