Skip to content

Refine prefill CUDA graph capture sizes#1331

Merged
shihaobai merged 2 commits into
mainfrom
prefill_cudagraph
Jun 4, 2026
Merged

Refine prefill CUDA graph capture sizes#1331
shihaobai merged 2 commits into
mainfrom
prefill_cudagraph

Conversation

@shihaobai
Copy link
Copy Markdown
Collaborator

No description provided.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the generation of graph_handle_token_nums in prefill_cuda_graph.py to use a combination of specific ranges instead of exponential values. A critical runtime bug was identified where set[int](...) is used, which will raise a TypeError in Python because generic type subscription is not callable at runtime. The reviewer recommended reverting this to set(...).

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

graph_handle_token_nums.append(self.max_handle_token_num)

graph_handle_token_nums = list(set(graph_handle_token_nums))
graph_handle_token_nums = list(set[int](graph_handle_token_nums))
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.

critical

Using set[int](...) at runtime will raise a TypeError: 'types.GenericAlias' object is not callable in Python. Subscription of built-in types like set[...] is only for type annotations and cannot be instantiated directly. Use set(...) instead.

Suggested change
graph_handle_token_nums = list(set[int](graph_handle_token_nums))
graph_handle_token_nums = list(set(graph_handle_token_nums))

@shihaobai shihaobai merged commit 63269d5 into main Jun 4, 2026
1 check passed
@shihaobai shihaobai deleted the prefill_cudagraph branch June 4, 2026 13:01
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.

1 participant