pytorch / pytorch/benchmark

AttributeError: 'ModelTask' object has no attribute 'replace_invoke'

Open
#2,606 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
346
PR merge metrics
No merged PRs in 30d

Description

When I run python3 run_benchmark.py test-user-invoke --model alexnet, I get an AttributeError error:

Running TorchBenchModelConfig(name='alexnet', test='eval', device='cuda', batch_size=1, extra_args=[], extra_env=None, output_dir=None, skip=False) ...Traceback (most recent call last):
  File "/home/chensichao/benchmark-mm/run_benchmark.py", line 48, in <module>
    run()
  File "/home/chensichao/benchmark-mm/run_benchmark.py", line 41, in run
    benchmark.run(bm_args)
  File "/home/chensichao/benchmark-mm/userbenchmark/test-user-invoke/run.py", line 94, in run
    result = run_config(config)
  File "/home/chensichao/benchmark-mm/userbenchmark/test-user-invoke/run.py", line 72, in run_config
    inject_model_invoke(model, user_defined_invoke)
  File "/home/chensichao/benchmark-mm/torchbenchmark/util/experiment/instantiator.py", line 45, in inject_model_invoke
    model_task.replace_invoke(inject_function.__module__, inject_function.__name__)
AttributeError: 'ModelTask' object has no attribute 'replace_invoke'

Then I search the source code, and I find that replace_invoke is not implemented in the code.

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 userbenchmark/test-user-invoke/run.py and torchbenchmark/util/experiment/instantiator.py, then inspect the ModelTask definition referenced by inject_model_invoke. Run python3 run_benchmark.py test-user-invoke --model alexnet to reproduce the AttributeError; done means this invocation no longer fails because ModelTask lacks replace_invoke.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa, 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.