infra: [TRTLLM-4450] Support more files for pytorch only mode (#3365)

* infra: [TRTLLM-4450] Support more files for pytorch only mode

Signed-off-by: ZhanruiSunCh <184402041+ZhanruiSunCh@users.noreply.github.com>

* Test pytorch only mode

Signed-off-by: ZhanruiSunCh <184402041+ZhanruiSunCh@users.noreply.github.com>

* Revert "Test pytorch only mode"

This reverts commit b32f54d7858bd2432251734bc7b31669147ed94b.

Signed-off-by: ZhanruiSunCh <184402041+ZhanruiSunCh@users.noreply.github.com>

* Fix review

Signed-off-by: Zhanrui Sun <184402041+ZhanruiSunCh@users.noreply.github.com>

---------

Signed-off-by: ZhanruiSunCh <184402041+ZhanruiSunCh@users.noreply.github.com>
Signed-off-by: Zhanrui Sun <184402041+ZhanruiSunCh@users.noreply.github.com>
This commit is contained in:
Zhanrui Sun 2025-04-09 01:39:04 +08:00 committed by GitHub
parent 54ad95eaa8
commit 7199588796
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -565,7 +565,13 @@ def getOnlyPytorchFileChanged(pipeline, testFilter, globalVars) {
pipeline.echo("Force set ONLY_PYTORCH_FILE_CHANGED false.")
return false
}
def pytorchOnlyPattern = ~/^tensorrt_llm\/_torch\/.*/
def pytorchOnlyList = [
"tensorrt_llm/_torch/",
"tests/unittest/_torch/",
"tests/integration/defs/accuracy/test_llm_api_pytorch.py",
"tests/integration/defs/disaggregated/",
"examples/pytorch/",
]
def changedFileList = getMergeRequestChangedFileList(pipeline, globalVars)
@ -573,12 +579,20 @@ def getOnlyPytorchFileChanged(pipeline, testFilter, globalVars) {
return false
}
def result = changedFileList.every { file ->
def isPytorchFile = file =~ pytorchOnlyPattern
def result = true
for (file in changedFileList) {
def isPytorchFile = false
for (prefix in pytorchOnlyList) {
if (file.startsWith(prefix)) {
isPytorchFile = true
break
}
}
if (!isPytorchFile) {
pipeline.echo("Found non-PyTorch file: ${file}")
result = false
break
}
return isPytorchFile
}
pipeline.echo("Only PyTorch files changed: ${result}")