diff --git a/.github/workflows/xpu-compile.yml b/.github/workflows/xpu-compile.yml index 6d8968ee3c53..eee52bee8faf 100644 --- a/.github/workflows/xpu-compile.yml +++ b/.github/workflows/xpu-compile.yml @@ -56,5 +56,5 @@ jobs: cd tests/torch_compile export ZE_AFFINITY_MASK=0,1 deepspeed test_compile.py --deepspeed_config ds_config.json 2>&1 | tee log.txt - #cat log.txt | grep "'graph_breaks'" | sed 's/,/ /g' | awk '{print $2}' >> $GITHUB_STEP_SUMMARY - cat log.txt + # for each line start with 'dynamo_output', extract the second field and following fields and append to GITHUB_STEP_SUMMARY using awk + cat log.txt | awk '/^dynamo_output/ {$1=""; print $0}' >> $GITHUB_STEP_SUMMARY diff --git a/tests/torch_compile/test_compile.py b/tests/torch_compile/test_compile.py index 680ff7b0c70f..49586d9363d4 100644 --- a/tests/torch_compile/test_compile.py +++ b/tests/torch_compile/test_compile.py @@ -104,8 +104,10 @@ def forward(self, data, residual): # print break down of graph break stats with markdown, print in table format, start with number of graph breaks, which is second item of each tuple. Then follow by reason, which is first item of each tuple # print a table head first # then print total number at the end of the table - print("| Reason | Count |") - print("| ------ | ----- |") + # print a tag 'dynamo_output' before each line to allow post processing + print("dynamo_output | Reason | Count |") + print("dynamo_output | ------ | ----- |") for item in dynamo_stats.items(): - print(f"| {item[0]} | {item[1]} |") - print(f"| Total | {sum(dynamo_stats.values())} |") + print(f"dynamo_output | {item[0]} | {item[1]} |") + print("dynamo_output | ------ | ----- |") + print(f"dynamo_output | Total | {sum(dynamo_stats.values())} |")