Fix Chakra Converter Handling of NCCL All-to-All, Logging Consistency, and HTA Dependency Issues #160
+72
−64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses multiple issues in the Chakra converter:
1. Improper Handling of NCCL All-to-All Communication
Chakra incorrectly distinguishes between point-to-point and collective communication. In NCCL, all-to-all is implemented as point-to-point communication, but Chakra's current logic treats these as distinct, leading to an incorrect type for
PyTorchNode
. More details on NCCL point-to-point can be found here.2. Logging Inconsistency
There was a mismatch in logging levels: sync dependencies log via
logging.info
, while other dependencies uselogging.debug
. This PR resolves the inconsistency by standardizing the logging approach.3. False Positive Dependencies from HTA
HTA returns false positives for sync dependencies, leading to invalid
later op -> earlier op
dependencies. This causes Chakra to fail in certain traces. The Chakra converter was found to encounter two critical failures:4. Support for PyTorch >2.5.0 and Updated Chakra Schema
The nightly version of PyTorch >2.5.0 appears to require support for schema version
1.1.1-chakra.0.0.4
.Updated Chakra to include the most recent schema version in its supported list.
5. Proper Encoding of pg_name in Collective Operations
Identified an issue where
Reduce-Scatter
andAll-Gather
operations do not correctly encode pg_name following updates on the PyTorch side.Modified Chakra to ensure proper encoding of
pg_name
in these collective operations.6. Handling HTA Errors in Chakra
The trace linker was terminating unexpectedly due to errors in HTA. Although this may stem from trace inconsistencies, the issue does not occur when HTA is excluded.
Updated Chakra to handle these errors by raising exceptions instead of terminating the trace linker.
Test Plan
I tested the fixes using Mixtral 8x3B traces collected with the NeMo framework (NVIDIA).
traces_device_0.zip