Skip to content

Conversation

akhilg-nv
Copy link
Collaborator

No description provided.

@akhilg-nv akhilg-nv changed the title #230: Support collections of tensors in args/kwargs for compile #343: Support collections of tensors in args/kwargs for compile Oct 13, 2025
if any(isinstance(v, (InputInfo, DimensionInputInfo)) for v in arg.values()):
input_names.add(name)
result = {}
for key, value in arg.items():
Copy link
Collaborator

Choose a reason for hiding this comment

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

What if the keys are not strings/implicitly convertible to strings?

Comment on lines +296 to +298
for nested_name in sorted(trace_input_map.keys()):
if nested_name.startswith(f"{name}.") or nested_name.startswith(f"{name}["):
nested_tensors.append(trace_input_map[nested_name].trace_tensor)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we just populate the trace_input_map as we call process_arg instead of doing this extra step?


# Handle containers of InputInfo objects
if isinstance(arg, dict):
if any(isinstance(v, (InputInfo, DimensionInputInfo)) for v in arg.values()):
Copy link
Collaborator

Choose a reason for hiding this comment

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

This check needs to be removed to support nested collections. Same for lists below.

Comment on lines +222 to +223
else:
return []
Copy link
Collaborator

Choose a reason for hiding this comment

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

When is this branch reached?

Comment on lines +220 to +221
if name_prefix in input_info_names:
return [tensor]
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can pull this out to the top of the extract_recursive method and that'll also let you drop the checks on lines 204 and 214 (i.e. you can unconditionally make the recursive call).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants