-
-
Notifications
You must be signed in to change notification settings - Fork 431
Closed
Description
Describe the bug
I am trying to use Scalene to profile my Python code, but I've encountered an issue where the GPU, memory usage, and copy columns are not displaying correctly in the profiling output.
To Reproduce
Steps to reproduce the behavior:
- Create module.
# my_profiling.py
import numpy as np
if __name__ == "__main__":
for _ in range(100):
arr = np.array(np.array(np.array(np.array(np.random.random((100_000, 10))))))
- Terminal: conda activate my_env
- Terminal: cd /path_to_my_file/
- Terminal: scalene --cli my_profiling.py
- See result
my_profiling.py: % of time = 100.00% (2.941s) out of 2.941s.
╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷
│Time │–––––– │––––… │–––––– │Memory │–––––– │––––––––––– │Copy │
Line │Python │native │syst… │GPU │Python │peak │timeline/% │(MB/s) │/home/dlxxx/Dokumente/python/profiling/my_profiling.py
╺━━━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━━━━━━━━━━┿━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
1 │ 1% │ 4% │ 1% │ 2% │ │ │ │ │import numpy as np
2 │ │ │ │ │ │ │ │ │
3 │ │ │ │ │ │ │ │ │if __name__ == "__main__":
4 │ │ │ │ │ │ │ │ │ for _ in range(100):
5 │ 48% │ 17% │ 28% │ 98% │ │ │ │ │ arr = np.array(np.array(np.array(np.array(np.random.random((100_000, 10))))))
6 │ │ │ │ │ │ │ │ │
╵ ╵ ╵ ╵ ╵ ╵ ╵ ╵ ╵
NOTE: The GPU is currently running in a mode that can reduce Scalene's accuracy when reporting GPU utilization.
Run once as Administrator or root (i.e., prefixed with `sudo`) to enable per-process GPU accounting.
- There is a note: "enable per-process GPU accounting."
- Get Python path for virtual environment: Terminal: which python3
- Terminal: sudo /home/xxx/miniconda3/envs/my_env/bin/python3 -m scalene --cli my_profiling.py
- See result
my_profiling.py: % of time = 100.00% (2.808s) out of 2.808s.
╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷
│Time │–––––– │––––… │–––––– │Memory │–––––– │––––––––––– │Copy │
Line │Python │native │syst… │GPU │Python │peak │timeline/% │(MB/s) │/home/dlxxx/Dokumente/python/profiling/my_profiling.py
╺━━━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━━┿━━━━━━━━━━━━━━━┿━━━━━━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╸
1 │ 2% │ 3% │ │ │ │ │ │ │import numpy as np
2 │ │ │ │ │ │ │ │ │
3 │ │ │ │ │ │ │ │ │if __name__ == "__main__":
4 │ │ │ │ │ │ │ │ │ for _ in range(100):
5 │ 52% │ 16% │ 26% │ │ │ │ │ │ arr = np.array(np.array(np.array(np.array(np.random.random((100_000, 10))))))
6 │ │ │ │ │ │ │ │ │
Expected behavior
The output I get from Scalene does not show the GPU, memory usage, and copy columns as expected. Instead, these columns appear empty, and the values are not displayed.
Desktop (please complete the following information):
- OS: Linux Mint 21.2
- Browser Firefox version 119.0
- Python version 3.10.13
- Scalene version 1.5.31.1 (2023.09.15)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels