mlc-ai / mlc-ai/web-stable-diffusion

raise TypeError(f"Please convert {rhs} with `const` first")

Open
#36 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
3.7k
Forks
238
PR merge metrics
No merged PRs in 30d

Description

while loading model ,get

text_config_dict` is provided which will be used to initialize `CLIPTextConfig`. The value `text_config["id2label"]` will be overriden.
Traceback (most recent call last):
  File "/srv/workspace/anaconda3/envs/web_sd/lib/python3.9/site-packages/torch/_dynamo/output_graph.py", line 670, in call_user_compiler
    compiled_fn = compiler_fn(gm, self.fake_example_inputs())
  File "/srv/workspace/anaconda3/envs/web_sd/lib/python3.9/site-packages/torch/_dynamo/debug_utils.py", line 1055, in debug_wrapper
    compiled_gm = compiler_fn(gm, example_inputs)
  File "/srv/workspace/framework/tvm/python/tvm/relax/frontend/torch/dynamo.py", line 151, in _capture
    mod_ = from_fx(
  File "/srv/workspace/framework/tvm/python/tvm/relax/frontend/torch/fx_translator.py", line 1421, in from_fx
    return TorchFXImporter().from_fx(
  File "/srv/workspace/framework/tvm/python/tvm/relax/frontend/torch/fx_translator.py", line 1308, in from_fx
    self.env[node] = self.convert_map[func_name](node)
  File "/srv/workspace/framework/tvm/python/tvm/relax/frontend/torch/fx_translator.py", line 180, in _add
    return lhs + rhs
  File "/srv/workspace/framework/tvm/python/tvm/relax/expr.py", line 155, in __add__
    return _binary_op_helper(self, other, _op_ffi_api.add)  # type: ignore
  File "/srv/workspace/framework/tvm/python/tvm/relax/expr.py", line 104, in _binary_op_helper
    raise TypeError(f"Please convert {rhs} with `const` first")
TypeError: Please convert 1 with `const` first

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the model-loading failure and start with tvm/relax/frontend/torch/fx_translator.py at _add, then trace the operation into tvm/relax/expr.py. Check whether the failing conversion can be handled for this PyTorch graph; done means the model loads without the reported TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
compilers, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.