Bug Report: Missing required positional argument 'loader_name' in add_loader_if_nondefault
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 13.4k
- Forks
- 2.4k
- Avg merge
- 5d 3h
- Merged PRs (30d)
- 2
Description
Description
In the module polygraphy.tools.args.backend.trt.loader, the function add_loader_if_nondefault is defined with parameters (loader, result_var_name, **kwargs). The loader_name argument is not defined as a required positional parameter in its signature.
However, the function's first line calls make_invocable_if_nondefault_kwargs(loader, loader_name, **kwargs), which requires loader_name. This causes a runtime error because loader_name is not provided when the function is called later in the code, as seen in examples like:
python
loader_name = add_loader_if_nondefault(
"PostprocessNetwork",
f"postprocess_step_{i}",
func=pps,
name=f"{script_path}:{func_name}",
)
This is a bug because the function's interface does not match its implementation, leading to a missing argument error.
Polygraphy ver. 0.49.26
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open polygraphy.tools.args.backend.trt.loader and inspect add_loader_if_nondefault, make_invocable_if_nondefault_kwargs, and the shown call site. Use the reported invocation as a reproduction, then verify that the interface and implementation agree and that the missing-argument error no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100