File tree Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Expand file tree Collapse file tree 3 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 1+ import  os 
12import  sys 
23from  src .benchmark .utils  import  read_metrics , to_html_table 
34
45if  __name__  ==  "__main__" :
56    # Generate statistics report 
6-     metrics  =  read_metrics (sys .argv [1 ], metric = "accuracy" )
7+     statistics_path  =  sys .argv [1 ]
8+     metrics  =  read_metrics (statistics_path , metric = "accuracy" )
79    html_table  =  to_html_table (metrics )
8-     print (html_table )
10+ 
11+     # Write to workflow job summary 
12+     summary_path  =  os .environ ["GITHUB_STEP_SUMMARY" ]
13+     with  open (summary_path , "a" ) as  f :
14+         f .write ("## My Job Summary\n " )
15+         f .write (html_table )
Original file line number Diff line number Diff line change @@ -117,22 +117,16 @@ jobs:
117117          retention-days : 1 
118118          overwrite : true 
119119
120-       - name : Generate statistics report 
120+       - name : Write to workflow job summary 
121121        id : report 
122122        run : | 
123123          set -x 
124124          realpath benchmark/ascend_npu_benchmark.json 
125125          ls benchmark 
126126          cat benchmark/ascend_npu_benchmark.json 
127-           output_path=$(realpath benchmark/ascend_npu_benchmark.json) 
128-           table=$(python .ci/benchmark.py ${output_path}) 
129-           echo "table=${table}" >> $GITHUB_OUTPUT 
130127
131-        - name : Write to workflow job summary 
132-         if : ${{ steps.report.outputs.table }} 
133-         run : | 
134-           echo "## Torchbenchmark statistics report" >> $GITHUB_STEP_SUMMARY 
135-           echo "${{ steps.report.outputs.table }}" >> $GITHUB_STEP_SUMMARY 
128+           output_path=$(realpath benchmark/ascend_npu_benchmark.json) 
129+           python .ci/benchmark.py ${output_path} 
136130
137131       - name : Modify README.md 
138132        if : ${{ always() }} 
Original file line number Diff line number Diff line change @@ -37,6 +37,9 @@ def save_file(path: str, data) -> None:
3737
3838
3939def  parse_to_dict (config_str : str ):
40+     """ 
41+     Parse a string (like 'key1=value1, key2=value2, ...') into a dict 
42+     """ 
4043    items  =  config_str .split (", " )
4144    config  =  {}
4245
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments