chakra icon indicating copy to clipboard operation
chakra copied to clipboard

Question about Chakra Trace Generated by PyTorch

Open Cioccoo opened this issue 1 year ago • 3 comments

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.

Cioccoo avatar Sep 06 '24 12:09 Cioccoo

I found a workaround to solve this problem: https://stackoverflow.com/questions/71759248/importerror-cannot-import-name-builder-from-google-protobuf-internal.

However, I still want to ask about the version requirements for Python, PyTorch, and especially Protobuf and other packages.

I always encounter version compatibility issues, especially when I want to use Chakra together with Astra-Sim 2.0.

Cioccoo avatar Sep 06 '24 13:09 Cioccoo

I'm facing a similar issue as well

rafsalas19 avatar Sep 06 '24 22:09 rafsalas19

Use python version 3.8 to install & run

sanalcc1 avatar Jun 17 '25 06:06 sanalcc1