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 fails to perf a python based command line #40

Closed FabioLuporini closed 1 year ago

FabioLuporini commented 1 year ago

I know that this has been reported internally but I thought it would be useful to leave a trace here on GitHub.

Reproducer:

omniperf profile -n devito_iso -- /global/home/ymmu/projects/devito-venv/bin/python devitopro/demos/iso_acoustic/run.py -d 512 512 512 -so 8 --nt 10 -opt "('advanced', {'par-tile': (32, 4, 4)})"

fails with:

Kernel Selection:  None
Dispatch Selection:  None
IP Blocks: All
RPL: on '221122_144013' from '/opt/rocm-5.1.3/rocprofiler' in '/app'
RPL: profiling '""/venv/bin/python devitopro/demos/iso_acoustic/run.py -d 512 512 512 -nt 400 -so 8 -opt ('advanced', {'par-tile': (32, 4, 8)})""'
RPL: input file '/app/workloads/omniperf-iso-acoustic/mi200/perfmon/SQ_INST_LEVEL_LDS.txt'
RPL: output dir '/tmp/rpl_data_221122_144013_1247'
RPL: result dir '/tmp/rpl_data_221122_144013_1247/input0_results_221122_144013'
/usr/bin/rocprof: eval: line 286: syntax error near unexpected token `('

<error trace continues>

If I remove the -opt "('advanced', {'par-tile': (32, 4, 4)})" part, then it works

coleramos425 commented 1 year ago

Given the oddness in that command-line option we recommend you try putting the launch command in a wrapper script, then profile the resulting script. We found something like this wrapper.sh script did the trick

#!/bin/bash                                                                     

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

python3 $SCRIPT_DIR/run.py -d 512 512 512 -so 8 --nt 10 "--opt ('advanced', {'par-tile': (32, 4, 8)})"

then profiling wrapper.sh instead. Let us know if this resolves your issue @FabioLuporini.

CC: @koomie

coleramos425 commented 1 year ago

Closing issue.