Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions tensorrt_llm/_torch/compilation/remove_copy_pass.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,17 @@ def remove_copy_for_mutates_args(graph: Graph):

nodes_to_remove: list[Node] = []

def remove_functionalize_inner(node: Node, mutates_args: dict, is_v2=False):
def remove_functionalize_inner(node: Node, mutates_args: dict):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Remove the stale is_v2 keyword argument.

remove_functionalize_inner no longer accepts is_v2, but Lines 76-80 still pass it. Every recognized functionalized node will therefore fail with TypeError: unexpected keyword argument 'is_v2' before the copy-removal logic executes.

Proposed fix
         remove_functionalize_inner(
             node,
             inplace_map[inplace_func],
-            is_v2=node.target == auto_functionalized_v2,
         )

Also applies to: 76-80

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/_torch/compilation/remove_copy_pass.py` at line 34, Remove the
stale is_v2 keyword argument from every call to remove_functionalize_inner in
the functionalized-node handling path, especially the calls around lines 76-80.
Keep the existing node and mutates_args arguments unchanged so recognized nodes
proceed to the copy-removal logic without a TypeError.

getitem_nodes = [
user for user in node.users if is_call_function(user, getitem)
]

kwargs = {k: v for k, v in node.kwargs.items() if not k.startswith("_")}
if is_v2:
if is_call_function(node, auto_functionalized_v2):
all_bases = node.kwargs["_all_bases"]
for arg in inplace_func._schema.arguments:
if arg.alias_info is None or not arg.alias_info.is_write:
continue
base_index_key = f"_{arg.name}_base_index"
base_index = node.kwargs[base_index_key]
kwargs[arg.name] = (None if base_index is None else
for arg_name in mutates_args.values():
base_index = node.kwargs.get(f"_{arg_name}_base_index")
kwargs[arg_name] = (None if base_index is None else
all_bases[base_index])

for getitem_node in getitem_nodes:
Expand Down
4 changes: 0 additions & 4 deletions tests/integration/test_lists/waives.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,6 @@ full:L40S/accuracy/test_llm_api_autodeploy.py::TestLlama3_1_8B::test_auto_dtype[
full:L40S/accuracy/test_llm_api_autodeploy.py::TestLlama3_1_8B::test_auto_dtype[trtllm-False-1] SKIP (https://nvbugs/6322045)
full:L40S/accuracy/test_llm_api_autodeploy.py::TestNemotronH::test_auto_dtype[trtllm-flashinfer_ssm-False] SKIP (https://nvbugs/6327147)
full:L40S/accuracy/test_llm_api_autodeploy.py::TestNemotronH::test_auto_dtype[trtllm-triton_ssm-False] SKIP (https://nvbugs/6327147)
full:L40S/accuracy/test_llm_api_pytorch.py::TestLlama3_1_8BInstruct::test_fp8[fp8kv=False-attn_backend=FLASHINFER-torch_compile=True] SKIP (https://nvbugs/6473161)
full:L40S/accuracy/test_llm_api_pytorch.py::TestLlama3_1_8BInstruct::test_fp8[fp8kv=True-attn_backend=FLASHINFER-torch_compile=True] SKIP (https://nvbugs/6473161)
full:L40S/accuracy/test_llm_api_pytorch.py::TestLlama3_1_8BInstruct::test_fp8_4gpus[tp4-fp8kv=False-attn_backend=FLASHINFER-torch_compile=True] SKIP (https://nvbugs/6473161)
full:L40S/accuracy/test_llm_api_pytorch.py::TestLlama3_1_8BInstruct::test_fp8_4gpus[tp4-fp8kv=True-attn_backend=FLASHINFER-torch_compile=True] SKIP (https://nvbugs/6473161)
full:L40S/accuracy/test_llm_api_pytorch.py::TestQwen3_30B_A3B::test_fp8[latency-torch_compile=True] SKIP (https://nvbugs/6276841)
full:L40S/accuracy/test_llm_api_pytorch_multimodal.py::TestExaone4_5_33B::test_auto_dtype[forced_chunked_prefill] SKIP (https://nvbugs/6327149)
full:L40S/accuracy/test_llm_api_pytorch_multimodal.py::TestExaone4_5_33B::test_auto_dtype[full_budget] SKIP (https://nvbugs/6327149)
Expand Down
Loading