mlcommons / mlcommons/chakra

Question about Chakra Trace Generated by PyTorch

Open
#151 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
196
Forks
84
PR merge metrics
No merged PRs in 30d

Description

Hello, I am a beginner just starting to learn. I really appreciate the great work your team does with Chakra.

I am following the tutorial: https://github.com/mlcommons/chakra/wiki/Running-Simulation-with-Chakra
Regarding "Using Chakra Execution Trace and Kineto Traces Generated By PyTorch," I encounter an error whenever I reach the section in the purple box:

image

The error is shown below:

(astra-sim) home123: ~/Documents/astra-sim/extern/graph_frontend/chakra$ python3 -m chakra.et_converter.et_converter --input_type PyTorch --input_filename et_plus/dlrm_eg_0_plus.json --output_filename et_plus/dlrm_chakra.0.et --

Traceback (most recent call last):
  File "/miniconda3/envs/astra-sim/lib/python3.9/runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/miniconda3/envs/astra-sim/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/miniconda3/envs/astra-sim/lib/python3.9/site-packages/chakra/et_converter/et_converter.py", line 9, in <module>
    from .text2chakra_converter import Text2ChakraConverter
  File "/miniconda3/envs/astra-sim/lib/python3.9/site-packages/chakra/et_converter/text2chakra_converter.py", line 8, in <module>
    from chakra.et_def.et_def_pb2 import (
  File "/miniconda3/envs/astra-sim/lib/python3.9/site-packages/chakra/et_def/et_def_pb2.py", line 9, in <module>
    from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (/miniconda3/envs/astra-sim/lib/python3.9/site-packages/google/protobuf/__init__.py)

May I ask why this issue occurs? Could it be related to my version of protobuf not being compatible?

I noticed that the tutorial mentions the need for protobuf 4.x. I tried different versions like protobuf 4.21.6 and 4.24.4, with Python 3.9, and PyTorch 2.1.2 and 2.4.0, and the latest version of chakra, but I keep encountering the same error.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the wiki's “Using Chakra Execution Trace and Kineto Traces Generated By PyTorch” section and the failing chakra.et_converter.et_converter entry point. Read text2chakra_converter.py and et_def_pb2.py around the google.protobuf import, then reproduce the command with the reported Python, PyTorch, and protobuf versions. Done means the converter command runs without the reported ImportError, with the compatible dependency requirement documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.