ROCm / rocprofiler-compute

Advanced Profiling and Analytics for AMD Hardware
https://rocm.docs.amd.com/projects/omniperf/en/latest/
MIT License
135 stars 49 forks source link

omniperf profile python workload is throwing error #108

Closed jxu-ca closed 1 year ago

jxu-ca commented 1 year ago

This is the command i use to profile my small python workload. omniperf profile -n optimizer -- python simple_NN.py

But i am getting following error message. usage: omniperf [mode] [options] tool: error: Your command "python" doesn't point to a file. Try again.

Can you please help? why profiler doesn't work on python code?

coleramos425 commented 1 year ago

Hello, could we try adding a shebang to top line of this Python file (i.e. #!/usr/bin/python3). Then re-run via

$ omniperf profile -n optimizer -- simple_NN.py
jxu-ca commented 1 year ago

Thanks for the quick response! Now, it is giving an error on the second line. import torch ModuleNotFoundError: No module named 'torch'

I am running the workload in pytorch docker, so i am not sure why it is still complaining torch not found. Also, just give a quick background, I was able to run the same code using MLPerf_CLI(link below) without any issue. https://confluence.amd.com/display/MLSE/Omniperf%28MIPerf%29+CLI+analysis But I was told MIPerf_CLI is deprecated and the omniperf is more up-to-date with bug fixes, so i am planning to use this instead. Thanks!

jrmadsen commented 1 year ago

Try using #!/usr/bin/env python3 instead. If your pytorch install is not using /usr/bin/python3 (very likely, it is probably in a conda env or Python virtual env), that recommendation is picking up the wrong Python installation

jxu-ca commented 1 year ago

Thanks! This is working! :-)