DeepWok / mase

Machine-Learning Accelerator System Exploration Tools
Other
108 stars 52 forks source link

Error in lab 2 - transform command #40

Closed JaredJoss closed 5 months ago

JaredJoss commented 5 months ago

I am trying to run the provided code to run the transform command in mase for lab 2:

./ch transform --config configs/examples/jsc_toy_by_type.toml --task cls --cpu=0

I am getting the following error:

 Traceback (most recent call last):
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/./ch", line 6, in <module>
    ChopCLI().run()
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/chop/cli.py", line 270, in run
    run_action_fn()
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/chop/cli.py", line 371, in _run_transform
    transform(**transform_params)
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/chop/actions/transform.py", line 70, in transform
    if len(graph.model.additional_inputs) > 0:
AttributeError: 'tuple' object has no attribute 'model'

I have pulled from the upstream and installed all packages.

bakhtiarZ commented 5 months ago

I am having the same issue

Aaron-Zhao123 commented 5 months ago

This was broken by a refactor, can you check now on pr #43

JaredJoss commented 5 months ago

@Aaron-Zhao123 When I pull the new changes in and do a pip install ., I get a new error:

Traceback (most recent call last):
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/./ch", line 6, in <module>
    ChopCLI().run()
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/chop/cli.py", line 270, in run
    run_action_fn()
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/chop/cli.py", line 372, in _run_transform
    transform(**transform_params)
  File "/Users/jared/Documents/Personal/ICL/courses/ADLS/mase/machop/chop/actions/transform.py", line 49, in transform
    model.to(accelerator)
  File "/opt/miniconda3/envs/mase_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1160, in to
    return self._apply(convert)
  File "/opt/miniconda3/envs/mase_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
    module._apply(fn)
  File "/opt/miniconda3/envs/mase_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 810, in _apply
    module._apply(fn)
  File "/opt/miniconda3/envs/mase_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 833, in _apply
    param_applied = fn(param)
  File "/opt/miniconda3/envs/mase_env/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1158, in convert
    return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
  File "/opt/miniconda3/envs/mase_env/lib/python3.10/site-packages/torch/cuda/__init__.py", line 289, in _lazy_init
    raise AssertionError("Torch not compiled with CUDA enabled")
AssertionError: Torch not compiled with CUDA enabled
Aaron-Zhao123 commented 5 months ago

I believe you passed in --accelerator gpu or something like that (you can check from the parameter table in the printout). However, your torch is not CUDA enabled, this is why you are getting this error.

JaredJoss commented 5 months ago

@Aaron-Zhao123, thank you. That was it.