Closed lessw2020 closed 3 months ago
Hi!
One way that is a bit cleaner than appending to the sys.path is using PYTHONPATH, for example:
PYTHONPATH=~/microxcaling/mx bash run_mx6.sh
We'll also look into setting up a python package as well soon.
I have tried two methods, but I still can't solve the problem.
The first:
>>> import sys
>>> sys.path.append("/home1/zks878/mx/microxcaling/mx/")
>>> print(sys.path)
['', '/home1/zks878/.conda/envs/zks878/lib/python39.zip', '/home1/zks878/.conda/envs/zks878/lib/python3.9', '/home1/zks878/.conda/envs/zks878/lib/python3.9/lib-dynload', '/home1/zks878/.conda/envs/zks878/lib/python3.9/site-packages', '/home1/zks878/mx/microxcaling/mx/']
>>>
(zks878) zks878@imdl5:~/mx/microxcaling/examples$ bash run_mxfp6.sh
Traceback (most recent call last):
File "/home1/zks878/mx/microxcaling/examples/ffn_mx_manual.py", line 6, in <module>
from mx import Linear, LayerNorm
ModuleNotFoundError: No module named 'mx'
The second:
(zks878) zks878@imdl5:~/mx/microxcaling/examples$ PYTHONPATH=~/home1/zks878/mx/microxcaling/mx
(zks878) zks878@imdl5:~/mx/microxcaling/examples$ bash run_mxfp6.sh
Traceback (most recent call last):
File "/home1/zks878/mx/microxcaling/examples/ffn_mx_manual.py", line 6, in <module>
from mx import Linear, LayerNorm
ModuleNotFoundError: No module named 'mx'
What should I do?
You'd better install microscaling module by runing "python install ." under microscaling directory. Then you can use MX module in your own python code.
Running the new example ffn_mx.py I get:
fix was to just add a path reference to mx:
However, not sure that there isn't a better way (i.e. setup.py from main dir) to resolve this.
Note that the example only works on single gpu...hangs on multi-gpu. Will open sep issue for that to differentiate.