@@ -105,15 +105,13 @@ def EXTRA_STAGE_LIST = "extra_stage"
105
105
@Field
106
106
def MULTI_GPU_FILE_CHANGED = " multi_gpu_file_changed"
107
107
@Field
108
- def ONLY_PYTORCH_FILE_CHANGED = " only_pytorch_file_changed "
108
+ def ONLY_ONE_GROUP_CHANGED = " only_one_group_changed "
109
109
@Field
110
110
def AUTO_TRIGGER_TAG_LIST = " auto_trigger_tag_list"
111
111
@Field
112
112
def DEBUG_MODE = " debug"
113
113
@Field
114
114
def DETAILED_LOG = " detailed_log"
115
- @Field
116
- def ONLY_DOCS_FILE_CHANGED = " only_docs_file_changed"
117
115
118
116
def testFilter = [
119
117
(REUSE_STAGE_LIST ): trimForStageList(gitlabParamsFromBot. get(REUSE_STAGE_LIST , null )?. tokenize(' ,' )),
@@ -127,11 +125,10 @@ def testFilter = [
127
125
(DISABLE_MULTI_GPU_TEST ): gitlabParamsFromBot. get((DISABLE_MULTI_GPU_TEST ), false ),
128
126
(EXTRA_STAGE_LIST ): trimForStageList(gitlabParamsFromBot. get((EXTRA_STAGE_LIST ), null )?. tokenize(' ,' )),
129
127
(MULTI_GPU_FILE_CHANGED ): false ,
130
- (ONLY_PYTORCH_FILE_CHANGED ): false ,
128
+ (ONLY_ONE_GROUP_CHANGED ): " " ,
131
129
(DEBUG_MODE ): gitlabParamsFromBot. get(DEBUG_MODE , false ),
132
130
(AUTO_TRIGGER_TAG_LIST ): [],
133
131
(DETAILED_LOG ): gitlabParamsFromBot. get(DETAILED_LOG , false ),
134
- (ONLY_DOCS_FILE_CHANGED ): false ,
135
132
]
136
133
137
134
String reuseBuild = gitlabParamsFromBot. get(' reuse_build' , null )
@@ -324,9 +321,8 @@ def setupPipelineEnvironment(pipeline, testFilter, globalVars)
324
321
echo " Env.gitlabMergeRequestLastCommit: ${ env.gitlabMergeRequestLastCommit} ."
325
322
echo " Freeze GitLab commit. Branch: ${ env.gitlabBranch} . Commit: ${ env.gitlabCommit} ."
326
323
testFilter[(MULTI_GPU_FILE_CHANGED )] = getMultiGpuFileChanged(pipeline, testFilter, globalVars)
327
- testFilter[(ONLY_PYTORCH_FILE_CHANGED )] = getOnlyPytorchFileChanged (pipeline, testFilter, globalVars)
324
+ testFilter[(ONLY_ONE_GROUP_CHANGED )] = getOnlyOneGroupChanged (pipeline, testFilter, globalVars)
328
325
testFilter[(AUTO_TRIGGER_TAG_LIST )] = getAutoTriggerTagList(pipeline, testFilter, globalVars)
329
- testFilter[(ONLY_DOCS_FILE_CHANGED )] = getOnlyDocsFileChanged(pipeline, testFilter, globalVars)
330
326
getContainerURIs(). each { k , v ->
331
327
globalVars[k] = v
332
328
}
@@ -644,86 +640,62 @@ def getMultiGpuFileChanged(pipeline, testFilter, globalVars)
644
640
return relatedFileChanged
645
641
}
646
642
647
- def getOnlyPytorchFileChanged (pipeline , testFilter , globalVars ) {
643
+ def getOnlyOneGroupChanged (pipeline , testFilter , globalVars ) {
648
644
def isOfficialPostMergeJob = (env. JOB_NAME ==~ / .*PostMerge.*/ )
649
645
if (env. alternativeTRT || isOfficialPostMergeJob) {
650
- pipeline. echo(" Force set ONLY_PYTORCH_FILE_CHANGED false ." )
651
- return false
646
+ pipeline. echo(" Force set ONLY_ONE_GROUP_CHANGED \"\" ." )
647
+ return " "
652
648
}
653
- def pytorchOnlyList = [
654
- " tensorrt_llm/_torch/" ,
655
- " tensorrt_llm/scaffolding/" ,
656
- " tests/unittest/_torch/" ,
657
- " tests/unittest/scaffolding/" ,
658
- " tests/unittest/llmapi/test_llm_pytorch.py" ,
659
- " tests/unittest/llmapi/test_llm_multi_gpu_pytorch.py" ,
660
- " tests/integration/defs/accuracy/test_llm_api_pytorch.py" ,
661
- " tests/integration/defs/disaggregated/" ,
662
- " examples/auto_deploy" ,
663
- " examples/disaggregated" ,
664
- " examples/pytorch/" ,
665
- " examples/scaffolding/" ,
666
- " docs/"
649
+ def groupFileMap = [
650
+ " Docs" : [ // TODO: Add more docs path to the list, e.g. *.md files in other directories
651
+ " docs/" ,
652
+ ],
653
+ " PyTorch" : [
654
+ " tensorrt_llm/_torch/" ,
655
+ " tensorrt_llm/scaffolding/" ,
656
+ " tests/unittest/_torch/" ,
657
+ " tests/unittest/scaffolding/" ,
658
+ " tests/unittest/llmapi/test_llm_pytorch.py" ,
659
+ " tests/unittest/llmapi/test_llm_multi_gpu_pytorch.py" ,
660
+ " tests/integration/defs/accuracy/test_llm_api_pytorch.py" ,
661
+ " tests/integration/defs/disaggregated/" ,
662
+ " examples/auto_deploy" ,
663
+ " examples/disaggregated" ,
664
+ " examples/pytorch/" ,
665
+ " examples/scaffolding/" ,
666
+ " docs/" ,
667
+ ],
668
+ " Triton" : [
669
+ " tests/integration/defs/triton_server/" ,
670
+ " triton_backend/" ,
671
+ ],
667
672
]
668
673
669
674
def changedFileList = getMergeRequestChangedFileList(pipeline, globalVars)
670
-
671
675
if (! changedFileList || changedFileList. isEmpty()) {
672
- return false
676
+ return " "
673
677
}
674
678
675
- def result = true
676
- for (file in changedFileList) {
677
- def isPytorchFile = false
678
- for (prefix in pytorchOnlyList) {
679
- if (file. startsWith(prefix)) {
680
- isPytorchFile = true
681
- break
682
- }
679
+ for (group in groupFileMap. keySet()) {
680
+ def groupPrefixes = groupFileMap[group]
681
+ def allFilesInGroup = changedFileList. every { file ->
682
+ groupPrefixes. any { prefix -> file. startsWith(prefix) }
683
683
}
684
- if (! isPytorchFile) {
685
- pipeline. echo(" Found non-PyTorch file: ${ file} " )
686
- result = false
687
- break
688
- }
689
- }
690
-
691
- pipeline. echo(" Only PyTorch files changed: ${ result} " )
692
- return result
693
- }
694
-
695
- def getOnlyDocsFileChanged (pipeline , testFilter , globalVars ) {
696
- def isOfficialPostMergeJob = (env. JOB_NAME ==~ / .*PostMerge.*/ )
697
- if (env. alternativeTRT || isOfficialPostMergeJob) {
698
- pipeline. echo(" Force set ONLY_DOCS_FILE_CHANGED false." )
699
- return false
700
- }
701
-
702
- // TODO: Add more docs path to the list, e.g. *.md files in other directories
703
- def docsFileList = [
704
- " docs/" ,
705
- ]
706
-
707
- def changedFileList = getMergeRequestChangedFileList(pipeline, globalVars)
708
- if (! changedFileList || changedFileList. isEmpty()) {
709
- return false
710
- }
711
684
712
- for (file in changedFileList) {
713
- def isDocsFile = false
714
- for (prefix in docsFileList) {
715
- if (file. startsWith(prefix)) {
716
- isDocsFile = true
717
- break
685
+ if (allFilesInGroup) {
686
+ pipeline. echo(" Only ${ group} files changed." )
687
+ return group
688
+ } else {
689
+ def nonGroupFile = changedFileList. find { file ->
690
+ ! groupPrefixes. any { prefix -> file. startsWith(prefix) }
691
+ }
692
+ if (nonGroupFile != null ) {
693
+ pipeline. echo(" Found non-${ group} file: ${ nonGroupFile} " )
718
694
}
719
- }
720
- if (! isDocsFile) {
721
- pipeline. echo(" Found non-docs file: ${ file} " )
722
- return false
723
695
}
724
696
}
725
- pipeline . echo( " Only docs files changed. " )
726
- return true
697
+
698
+ return " "
727
699
}
728
700
729
701
def collectTestResults (pipeline , testFilter )
@@ -1040,7 +1012,7 @@ def launchStages(pipeline, reuseBuild, testFilter, enableFailFast, globalVars)
1040
1012
testStageName = " [Test-SBSA] Remote Run"
1041
1013
}
1042
1014
1043
- if (testFilter[(ONLY_DOCS_FILE_CHANGED )] ) {
1015
+ if (testFilter[(ONLY_ONE_GROUP_CHANGED )] == " Docs " ) {
1044
1016
echo " SBSA build job is skipped due to Jenkins configuration or conditional pipeline run"
1045
1017
return
1046
1018
}
0 commit comments