NVIDIA / NVIDIA/TensorRT

Bug Report: Missing required positional argument 'loader_name' in add_loader_if_nondefault

Open
#4,595 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Module:Polygraphy
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.