Skip to content

Commit

Permalink
output to git summary file
Browse files Browse the repository at this point in the history
  • Loading branch information
delock committed Oct 6, 2024
1 parent 20022e1 commit 05fa0a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/xpu-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 6 additions & 4 deletions tests/torch_compile/test_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())} |")

0 comments on commit 05fa0a8

Please sign in to comment.