Skip to content

Update HolisticTraceAnalysis dependency to the traceinsight package - #217

Open
tejadhith wants to merge 1 commit into
mlcommons:mainfrom
tejadhith:update-hta-dependency
Open

tejadhith wants to merge 1 commit into
mlcommons:mainfrom
tejadhith:update-hta-dependency

Conversation

@tejadhith

Copy link
Copy Markdown

Summary

Chakra pins HolisticTraceAnalysis (HTA) to git commit d731cc2e in pyproject.toml, in both CI workflows (python_tests, end_to_end_tests), and in USER_GUIDE.md. That mid-2024 checkpoint predates HTA's pandas-2.x compatibility fix (HTA PR #333), so running chakra_trace_link on a real trace logs Critical path analysis encountered an invalid graph structure: Cannot specify both 'axis' and 'index'/'columns' and silently skips critical-path analysis.

HTA now publishes its releases to PyPI under the renamed distribution traceinsight (0.6.0 / 0.6.1); the importable module remains hta, so no source changes are needed. This PR replaces the pinned git checkout with the traceinsight package across pyproject.toml, both CI workflows, and USER_GUIDE.md — which also removes the manual clone/submodule/editable-install step from CI.

Test Plan

Environment: Python 3.13, torch 2.9.0+cu128, 2× V100; traceinsight 0.6.1, PARAM et_replay, networkx 3.6.1.

  • Unit suite: python -m pytest tests → 117 passed (no regression).
  • End-to-end, single-rank MLP: chakra_trace_link →
    • before (HTA 0.5.0): Cannot specify both 'axis' and 'index'/'columns', critical path skipped.
    • after (traceinsight 0.6.1): calculating critical path took 0.0027s, Linking process successful; chakra_converter → valid .et (115 COMP_NODE).
  • End-to-end, 2-rank DDP/NCCL: link + convert succeed; .et = 154 COMP_NODE + 1 METADATA_NODE + 2 COMM_COLL_NODE (ncclDevKernel_AllReduce_…); critical path runs. No regression on comm-heavy traces.
  • import hta still resolves (module name unchanged in traceinsight 0.6.x).

Additional Notes

  • HTA's PyPI distribution was renamed HolisticTraceAnalysis → traceinsight at 0.6.x; the importable module stays hta. traceinsight only exists at 0.6.0+, so a bare requirement cannot resolve below the fix.
  • No networkx change: the DiGraph.__new__ crash was specific to networkx 3.6.0 (networkx #8367) and is fixed in 3.6.1; nothing forces 3.6.0.
  • A new mlc-chakra PyPI release is needed to propagate this to pip install mlc-chakra users.
  • Refs: HTA PR #333 (pandas 2.x fix), networkx #8367.

@tejadhith
tejadhith requested a review from a team as a code owner July 7, 2026 17:37
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

MLCommons CLA bot All contributors have signed the MLCommons CLA ✍️ ✅

@jinsun-yoo jinsun-yoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the work. As a sanity check, coud you run the MLA conversion once more using the old version dependencies (networkx before 3.2.0, etc.), so that the generated Chakra graph stays the same before & after this change?

git submodule update --init
pip install -r requirements.txt
pip install -e .
pip install traceinsight

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this is now fixed to be a one-liner and is now represented in the requirements list in pyproject, perhaps we can remove this 'run item' altogether

Comment on lines 29 to +31
- name: Install HTA
run: |
git clone https://github.com/facebookresearch/HolisticTraceAnalysis.git
cd HolisticTraceAnalysis
git checkout d731cc2e2249976c97129d409a83bd53d93051f6
git submodule update --init
pip install -r requirements.txt
pip install -e .
pip install traceinsight

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ibid

Comment thread USER_GUIDE.md

### Step 4: Install Holistic Trace Analysis
Installing Holistic Trace Analysis is necessary for Trace link.
Installing Holistic Trace Analysis (published on PyPI as `traceinsight`) is necessary for Trace link.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's clarify: "published on PyPI as traceinsight - the old PyPi name HolisticTraceAnalysis is no longer valid"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this section too and the command below, let it happen directly with pypi pyproject.toml

Comment thread USER_GUIDE.md
@@ -36,15 +36,10 @@ $ pip install .
```

### Step 4: Install Holistic Trace Analysis

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, similar to above comments, just remove this?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Comment thread pyproject.toml
"networkx",
"pydot",
"HolisticTraceAnalysis @ git+https://github.com/facebookresearch/HolisticTraceAnalysis.git@d731cc2e2249976c97129d409a83bd53d93051f6"
"traceinsight"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a comment here clarifying this is HTA

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also maybe set a specific version in case HTA makes some changes?

Comment thread pyproject.toml
@@ -19,7 +19,7 @@ dependencies = [
"graphviz",
"networkx",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add >=3.6.1?

@mihncalo

Copy link
Copy Markdown

Environment used for testing

Python 3.13, torch 2.9.0+cu128, traceinsight 0.6.1, PARAM et_replay, networkx 3.6.1.

How the testing was done

  • Updated pyproject.toml to use requires-python 3.10 and ruff target-version py310, to prepare the environment ( these changes will come from the PR for Issue Raise requires-python to >=3.10 #224 )
  • Created a clean environment using python 3.13.17, to test with both pandas 2.x and 3.x
  • Followed the USER_GUIDE.md
  • Ran python -m pytest tests: All 117 tests are passing, 1 warning: DeprecationWarning: Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior
  • Ran the simple_onerank.py and simple_multirank.py scripts in trace_collection/post_execution/ to generate the required traces
  • Ran chakra_trace_link using both pandas 2.3.3 and pandas 3.0.6 and collected the logs
  • Ran chakra_converter on the resulted linked traces to generate the .et files and collected the logs

Results

The logs show that:

  • critical path runs: critical_path_analysis.py:1487 [INFO]: calculating critical path took 0.001714 seconds
  • the host and device traces are linked successfully: Linking process successful. Output file is available at ...
  • the linked traces are converted into .et files successfully: Conversion successful. Output file is available at ...

Additional Notes

Pandas 3.x needs at least python 3.11, which means that requires-python will need to be raised in the future.

@theodorbadea

Copy link
Copy Markdown
Contributor

Maybe we could pin pandas to 2.3.3 or <2.3.3 for now to avoid the possible conflict.

@jinsun-yoo

Copy link
Copy Markdown
Contributor

Related to #225 why not just pin 225 to 3.11?

@briancoutinho

Copy link
Copy Markdown

Sorry if this is a late comment but should we consider using uv instead for the installation?
Most projects are now moving to uv instead of pip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants