mlcommons / mlcommons/chakra

Can't convert text use et.converter

Open
#75 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the Bug

When I want to convert the Resnet_Dataparallel.txt use the following command

python3 -m chakra.et_converter.et_converter\
    --input_type Text\
    --input_filename  ../../inputs/workload/ASTRA-sim-1.0/Resnet50_DataParallel.txt\
    --output_filename ../../outputs/convert_result/Resnet50_DataParallel\
    --num_npus 4\
    --num_dims 2\
    --num_passes 1

a mistake happens

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/chakra/et_converter/et_converter.py", line 106, in main
    converter.convert()
  File "/usr/local/lib/python3.8/dist-packages/chakra/et_converter/text2chakra_converter.py", line 147, in convert
    self.convert_data_parallel(f, num_layers)
  File "/usr/local/lib/python3.8/dist-packages/chakra/et_converter/text2chakra_converter.py", line 202, in convert_data_parallel
    self.add_parent(fwd_comp_node, layers[idx-1].fwd_comp_node)
  File "/usr/local/lib/python3.8/dist-packages/chakra/et_converter/text2chakra_converter.py", line 136, in add_parent
    child_node.parent.append(parent_node.id)
AttributeError: parent

and then I search the file "text2chakra_converter.py"and "et_def_pb2.pyi" ,I find there is no attribute named parent in Node,the defination is there

class Node(_message.Message):
    __slots__ = ("id", "name", "type", "ctrl_deps", "data_deps", "start_time_micros", "duration_micros", "inputs", "outputs", "attr")
    ID_FIELD_NUMBER: _ClassVar[int]
    NAME_FIELD_NUMBER: _ClassVar[int]
    TYPE_FIELD_NUMBER: _ClassVar[int]
    CTRL_DEPS_FIELD_NUMBER: _ClassVar[int]
    DATA_DEPS_FIELD_NUMBER: _ClassVar[int]
    START_TIME_MICROS_FIELD_NUMBER: _ClassVar[int]
    DURATION_MICROS_FIELD_NUMBER: _ClassVar[int]
    INPUTS_FIELD_NUMBER: _ClassVar[int]
    OUTPUTS_FIELD_NUMBER: _ClassVar[int]
    ATTR_FIELD_NUMBER: _ClassVar[int]
    id: int
    name: str
    type: NodeType
    ctrl_deps: _containers.RepeatedScalarFieldContainer[int]
    data_deps: _containers.RepeatedScalarFieldContainer[int]
    start_time_micros: int
    duration_micros: int
    inputs: IOInfo
    outputs: IOInfo
    attr: _containers.RepeatedCompositeFieldContainer[AttributeProto]
    def __init__(self, id: _Optional[int] = ..., name: _Optional[str] = ..., type: _Optional[_Union[NodeType, str]] = ..., ctrl_deps: _Optional[_Iterable[int]] = ..., data_deps: _Optional[_Iterable[int]] = ..., start_time_micros: _Optional[int] = ..., duration_micros: _Optional[int] = ..., inputs: _Optional[_Union[IOInfo, _Mapping]] = ..., outputs: _Optional[_Union[IOInfo, _Mapping]] = ..., attr: _Optional[_Iterable[_Union[AttributeProto, _Mapping]]] = ...) -> None: ...

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 reported command and traceback in text2chakra_converter.py, especially convert_data_parallel and add_parent, then compare its Node usage with the Node definition shown in et_def_pb2.pyi. Done means the Resnet50_DataParallel.txt conversion completes without the AttributeError and produces the requested output.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.