-
Q: Why does the npu-monitor command via the dyno CLI report no data?
-
A: Troubleshoot in the following order:
- CANN version and msPTI dynamic library check: npu-monitor is implemented based on the msPTI interface.
- When CANN ≥ 9.0.0, msPTI is automatically loaded, and no additional
LD_PRELOADsetting is required. - For CANN < 9.0.0, set
export LD_PRELOAD=<CANN-path>/cann/lib64/libmspti.sobefore starting training.
- When CANN ≥ 9.0.0, msPTI is automatically loaded, and no additional
- dynolog daemon status check: Confirm that the dynolog daemon has started normally and that the
dynolog.sockfile exists under~(the current user home directory). - MSMONITOR_USE_DAEMON check: Confirm that
export MSMONITOR_USE_DAEMON=1has been set before starting the training or inference service. - Shared memory residue check: See the "Troubleshooting" section for handling shared memory residue.
- Log check: Check whether the dynolog log has normally received RPC requests from the dyno CLI.
- CANN version and msPTI dynamic library check: npu-monitor is implemented based on the msPTI interface.
-
Q: Why can't I collect profile data after sending a collection command via the dyno CLI?
-
A: Common causes and solutions are as follows:
-
dynolog daemon not started properly
- Check whether the
dynolog.sockfile exists in the~(the current user home directory) directory. If not, start the dynolog daemon first.
- Check whether the
-
MSMONITOR_USE_DAEMONenvironment variable not set- Before starting the training or inference service, run
export MSMONITOR_USE_DAEMON=1.
- Before starting the training or inference service, run
-
Residual shared memory files not cleaned up
- The msMonitor underlying layer relies on the Ascend PyTorch Dynamic Profiling mechanism. In a Python 3.8+ environment, a binary shared memory file named in the format
DynamicProfileNpuShm+timestampis generated in the/dev/shmdirectory. It is automatically cleaned up on a normal exit. If the process is forcibly terminated withpkill -9, the residual file causes collection exceptions within a short time (<1h). You are advised to check the/dev/shmdirectory before startup and manually delete any historical residual files.
- The msMonitor underlying layer relies on the Ascend PyTorch Dynamic Profiling mechanism. In a Python 3.8+ environment, a binary shared memory file named in the format
-
No data collected after setting the npu-monitor filter parameter
- Check whether
--filteris correct. You can first remove thefilterparameter to verify whether full collection works properly.
- Check whether
-
Improper configuration of npu-monitor mspti_activity_kind
- Verify that
--mspti-activity-kindis one of the allowed values:Marker, Kernel, API, Hccl, Memory, MemSet, MemCpy, Communication, AclAPI, NodeAPI, RuntimeAPI.
- Verify that
-
PyTorch Optimizer incompatibility
- In training scenarios, the PyTorch native optimizer or its derived classes must be used. For custom optimizers,
torch_npu.profiler.dynamic_profile.step()must be manually called at the end of each training iteration.
- In training scenarios, the PyTorch native optimizer or its derived classes must be used. For custom optimizers,
-
-
Q: Can npu-monitor and nputrace be used simultaneously?
-
A: No. npu-monitor and nputrace share underlying Profiling resources, which causes resource conflicts. One must be stopped before the other is started.
- Sending
npu-monitor startandnputraceat the same time is not supported, including the scenario where the two commands are issued one after the other within a short period and both stay in the daemon queue, the plug-in cache, or the shared memory. In this case, both commands may be accepted before npu-monitor reportsRunning, and the model process starts msPTI monitoring and then nputrace collection within the same step, causing a Profiling resource conflict. - The configuration cache only guarantees the delivery order and provides no mutual exclusion protection. As long as npu-monitor is not stopped, nputrace may still fail to start or its collection may be interrupted.
- When switching from npu-monitor to nputrace, run
dyno npu-monitor --npu-monitor-stopfirst, and send nputrace only afterdyno statusshowsnpumonitorasIdle. - In
dyno status,queue_depthandrejectedcount only nputrace configurations and do not include npu-monitor configurations, so they cannot indicate whether npu-monitor is queued.
- Sending
-
Q: Does msMonitor support vLLM inference scenarios?
-
A: Yes, but with limitations:
- For vLLM 0.11.0 and later versions, msMonitor automatically calls
torch_npu.profiler.dynamic_profile.step()in the model's forward method. - For earlier versions of vLLM, users must manually call
torch_npu.profiler.dynamic_profile.step(). - The vLLM inference model runs as a daemon. The
nputracescenario does not support online analysis. After collection is complete,torch_npu.profiler.profiler.analyse()must be manually invoked for analysis.
- For vLLM 0.11.0 and later versions, msMonitor automatically calls
-
Q: How is npu-monitor
--durationused? What doesduration=0mean? -
A:
--durationis in seconds and supports floating-point precision (for example,--duration 0.5means collecting for 500 ms).--duration 0(default): Indicates unlimited collection, which must be stopped manually via--npu-monitor-stop.--duration N(N > 0): Automatically stops and cleans up resources after N seconds of collection.--durationcan be used together with--stop: set a longer duration at startup, and terminate early viastopwhen an anomaly is detected.durationis not coupled withfilterand can be used in combination, for example,--duration 60 --filter "Kernel:Attention".
-
Q: How do I restart collection after the npu-monitor
--durationexpires? -
A: After the duration expires, MsptiMonitor automatically stops and releases all resources. To continue collection, the
--npu-monitor-startcommand must be re-sent to begin a new collection session. -
Q: What is the format of npu-monitor
--filter? What matching rules are supported? -
A: The filter format is
"Kind:OpName,OpName;Kind:OpName", with the following specific rules:- Activity kind and the operator name list are separated by
:. - Multiple activity types are separated by
;. - Multiple operator names under the same type are separated by
,. - Operator names support substring fuzzy matching (based on
string::find). For example,Matcan matchMatMul,BatchMatMul,MatMulBackward, and so on. - The maximum length of the filter string is 1024 characters.
Examples:
- Collect only the MatMul operator under the Kernel type:
--filter "Kernel:MatMul" - Collect multiple activity Kinds:
--filter "Kernel:MatMul,Conv2D;Communication:AllReduce" - Fuzzy matching:
--filter "Kernel:Mat"(matches all operators whose names contain "Mat")
- Activity kind and the operator name list are separated by
-
Q: After npu-monitor
--filteris set, can it be dynamically updated? Is it an overwrite or an append? -
A: Dynamic update is supported, and it is an overwrite behavior. When a configuration containing a
filteris issued again at runtime,SetFilterItems()replaces the original filtering rules. If additional operator names need to be appended, both the old and new rules must be included in the filter string. -
Q: Are npu-monitor Memory/MemSet/MemCpy type records not subject to filter restrictions?
-
A: Yes. These three memory operation types are added to the allowlist in
ShouldKeepRecord(), and they are retained regardless of the filter setting, ensuring the integrity of memory and performance analysis data. -
Q: What is the effect of npu-monitor
--filter ""(empty string)? -
A: An empty filter means no filtering is applied, and all operator data will be collected. This behavior is the same as when
--filteris not specified. -
Q: Under what conditions must nputrace
--async-modetake effect? -
A:
--async-modetakes effect only when PyTorch Profiler is used. Asynchronous parsing is not supported in MindSpore scenarios. When the mode is enabled, data parsing is executed in an independent subprocess, and the main process is not blocked.
-
Q: How do I troubleshoot IPC communication failures?
-
A: The IPC communication chain of msMonitor is: CLI → TCP/TLS (RPC) → Dynolog Server → Unix Domain Socket → model process. Troubleshoot in the following order:
- Confirm that the dynolog daemon is started and that
dynolog.sockexists in the~directory. - Confirm that the RPC port (default
1778) between the CLI and the Server is not blocked by the firewall. - Check the dynolog log for socket error codes such as
ECONNREFUSEDandEAGAIN. - The IPC client has a built-in exponential backoff retry mechanism (up to 10 times), and transient faults are automatically recovered.
- Confirm that the dynolog daemon is started and that
-
Q: What should I do if "Buffer allocation exhausted" or "allocCnt" alarms appear in the log?
-
A: The default maximum concurrency of msPTI buffers is 32 (256 MB in total). This rate limiting mechanism is triggered when the data production rate exceeds the consumption rate. When the buffer is insufficient, msPTI automatically slows down and drops data without causing process crashes. This can be mitigated through the following methods:
- Shorten
--report-interval-s(flush interval, default 60s) to accelerate buffer release. - Use filters to reduce the amount of consumed data and increase the buffer consumption rate.
- Shorten
-
Q: How do I troubleshoot collection exceptions caused by residual shared memory files?
-
A: When a model process is forcibly terminated by
pkill -9, theDynamicProfileNpuShm*shared memory files under the/dev/shmdirectory are not automatically cleaned up. Handling method:# Check for residual files ls -la /dev/shm/DynamicProfileNpuShm* # Manually delete them rm -f /dev/shm/DynamicProfileNpuShm*
It is recommended to write the cleanup command into the startup script before launching training.
-
Q: What should I do if the server does not recognize new parameters after updating the CLI?
-
A: If the
dynoCLI is updated but thedynologServer is not synchronously updated, unknown commands or parameters (such asstatus) sent by the new CLI will be ignored by the old Server. The new parameters will not take effect and no alarm will be generated. It is recommended to keep the CLI (dyno) and Server (dynolog) versions consistent. -
Q: What should I do if the collected DB/Jsonl file is empty or contains incomplete data?
-
A: Check the following possibilities:
- Duration too short: The collection duration is insufficient to trigger a flush (default 60s). It is recommended to set
--durationto be greater than the flush interval. - Filter settings too strict: All records are filtered out. An empty filter can be used first for verification.
- Disk full: When SQLite write fails, the transaction is automatically rolled back. Check the disk space and clean up.
- Duration too short: The collection duration is insufficient to trigger a flush (default 60s). It is recommended to set
-
Q: How can I verify the current working status of msMonitor?
-
A: The status can be confirmed through the following methods:
- Use the
dyno statuscommand to check the running status of the dynolog daemon. - Check whether the
dynolog.sockanddyno.sockfiles exist under~(the current user home directory). - Check the dynolog logs for information indicating successful model process registration, such as
Registered process (12345) for job 0. - Use
ps/topto check whether a thread namedMsptiMonitorexists.
- Use the
-
Q: Which Ascend products are supported by msMonitor?
-
A: msMonitor supports the following product types. For specific Ascend product models, see Ascend Product Models.
- Ascend 950PR&950DT products: Supported
- Atlas A3 products: Supported
- Atlas A2 products: Supported
- Atlas 200I/500 A2 inference products: Supported
- Atlas inference products: Not supported
- Atlas training products: Not supported
-
Q: What are the operating system and programming language requirements for msMonitor?
-
A: Only the Linux operating system (aarch64 and x86_64) is supported, with C++/Python as the programming languages.
-
Q: How do I update an installed msMonitor software package?
-
A: msMonitor consists of two software packages, dynolog and mindstudio_monitor, which can be downloaded from msMonitor Releases. Before updating, it is recommended to check the version compatibility table to confirm that the versions of all components match.
-
Update the dynolog software package.
# Debian/Ubuntu: sudo dpkg -r dynolog sudo dpkg -i --force-depends dynolog_{version}_{arch}.deb # CentOS/RHEL/OpenSUSE: sudo rpm -e dynolog sudo rpm -ivh dynolog_{version}_{arch}.rpm --nodeps
versionis the version number, andarchis the system architecture (x86_64/aarch64). -
Update the mindstudio_monitor software package.
pip uninstall mindstudio_monitor pip install mindstudio_monitor-{mindstudio_version}-cp{python_version}-cp{python_version}-linux_{arch}.whlmindstudio_versionis the MindStudio version number, andpython_versionis the Python version number (e.g., cp310, cp311).
-
-
Q: What are the runtime dependencies of the mindstudio_monitor .whl?
-
A: The runtime dependencies of the
mindstudio_monitor.whl package are as follows:Dependency Purpose pybind11 Python/C++ extension binding xlsxwriter Exporting the collected performance data to an Excel file (the monitor_result.xlsxgenerated bymonitor.save())When installing the .whl package, pip automatically installs the above dependencies:
pip install mindstudio_monitor-{mindstudio_version}-cp{python_version}-cp{python_version}-linux_{arch}.whlIn environments without network access (such as containers), ensure that the above dependencies are already installed; otherwise, msMonitor may fail to run properly.
-
Q: After upgrading to the new version, do existing collection scripts need to be modified?
-
A: No. The three newly added parameters,
--duration,--filter, and--async-mode, are all optional and have reasonable default values:durationdefaults to0.0(unlimited duration, behavior same as previous versions)filterdefaults to an empty string (no filtering, behavior same as previous)async-modedefaults tofalse(synchronous mode, behavior same as previous) When old scripts do not specify new parameters, the behavior is fully consistent with that before the upgrade.