[英]Workaround to successfully profile python script using scalene profiler on macOS? Just forget it and use machine with Windows or Linux?
Computational Science SE question How amenable is this 2D Frenkel–Kontorova-like energy minimization problem in Python to the use of a modest PC + GPU?计算科学 SE 问题Python 中的这个 2D Frenkel–Kontorova 式能量最小化问题对于使用适度的 PC + GPU 来说有多适用? (Heavy reliance on indexing) contains a short example script and note 3 links to my first attempt at profiling using scalene (严重依赖索引)包含一个简短的示例脚本和注释 3链接到我第一次尝试使用scalene进行分析
The results were uninformative, so I followed a recommendation that I try the --profile-all
option.结果没有提供任何信息,因此我遵循了尝试使用--profile-all
选项的建议。 After running for 30 minutes without finishing on a script that took seconds to run I added a CPU percent limit;在运行了 30 分钟但没有完成需要几秒钟运行的脚本后,我添加了 CPU 百分比限制; what I assume means only things that used at least 2% of the CPU time would be profiled in depth.我假设的意思是只有使用至少 2% 的 CPU 时间的东西才会被深入分析。
scalene --html --outfile prof.html --profile-all --cpu-percent-threshold 2 myscript.py
I received a two line error and was exited from python in a normal way.我收到两行错误,并以正常方式从 python 退出。
Error getting real path: 2
Scalene error: received signal SIGABRT
This issue was closed in scalene issue #110 and there are links there to此问题已在 scalene issue #110中关闭,并且那里有指向
Q: How do I use Scalene with PyTorch?问:如何将 Scalene 与 PyTorch 一起使用?
A: Scalene works with PyTorch version 1.5.1.答: Scalene 适用于 PyTorch 版本 1.5.1。 There's a bug in newer versions of PyTorch ( https://github.com/pytorch/pytorch/issues/57185 ) that interferes with Scalene (discussion here: https://github.com/plasma-umass/scalene/issues/110 ). There's a bug in newer versions of PyTorch ( https://github.com/pytorch/pytorch/issues/57185 ) that interferes with Scalene (discussion here: https://github.com/plasma-umass/scalene/issues/110 )。
there's more information there as well那里还有更多信息
and和
Question: Is there a workaround to successfully profile python script using scalene profiler on macOS?问题:是否有解决方法可以在 macOS 上使用 scalene 分析器成功分析 python 脚本? Or should I just move to a machine with Windows or Linux and forget about trying for now?还是我应该转移到一台带有 Windows 或 Linux 的机器上,暂时忘记尝试?
The message, Error getting real path: 2
, seems to have to do with scalene finding your script or a path internal to your script possibly.消息Error getting real path: 2
似乎与 scalene 查找脚本或脚本内部路径有关。 Ensure you're referencing a full, valid path for myscript.py
, taking into account which directory you're at in the terminal.确保您引用了myscript.py
的完整有效路径,同时考虑到您在终端中的哪个目录。 You may need to change directory.您可能需要更改目录。
The SIGABRT
message is different from the SIGSEGV
issue listed, though, if you wanted to test it, you could uninstall PyTorch ( pip uninstall torch
) and reinstall a specific version ( pip install 'torch==1.5.1'
). The SIGABRT
message is different from the SIGSEGV
issue listed, though, if you wanted to test it, you could uninstall PyTorch ( pip uninstall torch
) and reinstall a specific version ( pip install 'torch==1.5.1'
).
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.