Skip to content

Conversation

nvchenghaoz
Copy link

@nvchenghaoz nvchenghaoz commented Jul 23, 2025

The main change in this PR comparing to #89 is to handle the bool attn_mask.

The attn_mask could be bool type which cause the test error in the test_attention_matcher_hf.py.

Fridah-nv and others added 2 commits July 23, 2025 13:39
…t kv, sdpa and group attention, update unit tests

Signed-off-by: Frida Hou <[email protected]>
Signed-off-by: nvchenghaoz <[email protected]>
@nvchenghaoz nvchenghaoz requested a review from Fridah-nv July 23, 2025 23:08
…ng repeat kv, sdpa and group attention, update unit tests"

This reverts commit 5743fb3.
@nvchenghaoz nvchenghaoz self-assigned this Jul 23, 2025
@Fridah-nv
Copy link

Shall we have a unit test to map the behavior between torch_attention_grouped_sdpa and F.scaled_dot_product_attention? I see some difference when attn_mask=None and is_causal=False. This emerge from one test in test_attention_matcher. I'll summarize what I see with other attention matcher unit tests.

@nvchenghaoz
Copy link
Author

Shall we have a unit test to map the behavior between torch_attention_grouped_sdpa and F.scaled_dot_product_attention? I see some difference when attn_mask=None and is_causal=False. This emerge from one test in test_attention_matcher. I'll summarize what I see with other attention matcher unit tests.

Good point. Let me check the F.scaled_dot_product_attention. We probably need a unit test to compare the AD attention vs. torch attention.

@nvchenghaoz
Copy link
Author

/bot -h

Copy link

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental)]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-PyTorch-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@nvchenghaoz
Copy link
Author

/bot run

@Fridah-nv
Copy link

Fridah-nv commented Jul 24, 2025

Never mind about the unit test failure I mentioned, this PR should be compatible with #101 now

Btw, /bot run only works with upstream repo, we didn't configure CI in our fork repo.

@nvchenghaoz
Copy link
Author

Never mind about the unit test failure I mentioned, this PR should be compatible with #101 now

Btw, /bot run only works with upstream repo, we didn't configure CI in our fork repo.

@Fridah-nv I am looking for some options to setup a mini-CI for our own fork to prevent some late found bugs during the mass merge back to the upstream TRTLLM repo. I saw the /bot command suggestion in our MR description so I was wondering whether we could directly reuse that.

@nvchenghaoz nvchenghaoz enabled auto-merge (squash) July 26, 2025 00:11
@nvchenghaoz nvchenghaoz merged commit 7810dd0 into feat/ad-2025-07-22 Jul 26, 2025
1 check passed
@nvchenghaoz nvchenghaoz deleted the chenghao/torch-ref-0723 branch July 26, 2025 00:16
MrGeva pushed a commit that referenced this pull request Jul 29, 2025
* attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests

Signed-off-by: Frida Hou <[email protected]>

* Update the torch ref op

Signed-off-by: nvchenghaoz <[email protected]>

* Revert "attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests"

This reverts commit 5743fb3.

---------

Signed-off-by: Frida Hou <[email protected]>
Signed-off-by: nvchenghaoz <[email protected]>
Co-authored-by: Frida Hou <[email protected]>
h-guo18 pushed a commit that referenced this pull request Jul 30, 2025
* attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests

Signed-off-by: Frida Hou <[email protected]>

* Update the torch ref op

Signed-off-by: nvchenghaoz <[email protected]>

* Revert "attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests"

This reverts commit 5743fb3.

---------

Signed-off-by: Frida Hou <[email protected]>
Signed-off-by: nvchenghaoz <[email protected]>
Co-authored-by: Frida Hou <[email protected]>
lucaslie pushed a commit that referenced this pull request Jul 31, 2025
* attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests

Signed-off-by: Frida Hou <[email protected]>

* Update the torch ref op

Signed-off-by: nvchenghaoz <[email protected]>

* Revert "attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests"

This reverts commit 5743fb3.

---------

Signed-off-by: Frida Hou <[email protected]>
Signed-off-by: nvchenghaoz <[email protected]>
Co-authored-by: Frida Hou <[email protected]>
Fridah-nv added a commit that referenced this pull request Jul 31, 2025
* attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests

Signed-off-by: Frida Hou <[email protected]>

* Update the torch ref op

Signed-off-by: nvchenghaoz <[email protected]>

* Revert "attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests"

This reverts commit 5743fb3.

---------

Signed-off-by: Frida Hou <[email protected]>
Signed-off-by: nvchenghaoz <[email protected]>
Co-authored-by: Frida Hou <[email protected]>
Fridah-nv added a commit that referenced this pull request Jul 31, 2025
* attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests

Signed-off-by: Frida Hou <[email protected]>

* Update the torch ref op

Signed-off-by: nvchenghaoz <[email protected]>

* Revert "attention matcher with torch._inductor pattern matcher,matching repeat kv, sdpa and group attention, update unit tests"

This reverts commit 5743fb3.

---------

Signed-off-by: Frida Hou <[email protected]>
Signed-off-by: nvchenghaoz <[email protected]>
Co-authored-by: Frida Hou <[email protected]>
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