Skip to content

Reduce variability between compile outputs and transfertuning requests - #880

Draft
ramonwirsch wants to merge 2 commits into
mainfrom
llvm-stability
Draft

Reduce variability between compile outputs and transfertuning requests#880
ramonwirsch wants to merge 2 commits into
mainfrom
llvm-stability

Conversation

@ramonwirsch

Copy link
Copy Markdown
Member

Description

  • dot_viz sorts edges deterministically. Makes .dot files more deterministic
  • Context can also produce a shared_ptr of the context
  • RPCNodeTransform can optionally dump the cutout and response into sub-folders for debugging (default off, using output_dir metadata on sdfg)
  • updated llvm frontend to use DoccTargets and construct RpcLoopScheduler fresh when needed
  • updated llvm frontend to use the docc context for access to DoccTargets (no it vectorizes again)
  • added "applied_to_element_id" field to RPCNodeTransform reporting, so that we can identify which level of a loop nest was actually tuned
    ~ replaced global PassReportCollector with thread-safe management that creates reports per module.

Related Issues

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactor / internal change (no functional change)
  • Documentation update

Quality Checklist

Please ensure the following are completed before requesting review:

  • Runtime-compatible (no externally visible existing method has its parameters changed, was deleted or has its exception behavior changed)
  • Compile-time compatible (new arguments & properties added have default values, but users need to recompile against the new version to work)

IR:

  • Introduces new types into the SDFG IR
  • Changed / added properties on SDFG IR Elements (LibraryNodes, ControlFlowNodes DataFlowNodes etc.)
    • New / modified types have serialization / deserialization support
    • Deserialization is backward compatible (new serialization can deserialize old format and represent it in the new format if applicable)
    • Serialized format is backward compatible (previous deserializer can read new serialized format without incorrectness (just lacking additional guarantees that are optional or did not exist before)
    • Serializer has an option to emit the previous format

Unit Tests

  • New unit tests have been added for the changes.
  • Existing unit tests pass locally.
  • Edge cases and error paths are covered.

Integration Tests

  • New integration tests have been added (or existing ones updated).
  • Integration tests pass locally.
  • Interactions with other components/services are verified.

Documentation

  • Public APIs, options, and behavior changes are documented.
  • README / docs site / inline comments updated where applicable.
  • Changelog / release notes updated (if applicable).

Test Coverage

  • Test coverage has not decreased as a result of this change.
  • Coverage report reviewed and acceptable.
  • Critical / new code paths are covered.

How Has This Been Tested?

@daisytuner

daisytuner Bot commented Jul 24, 2026

Copy link
Copy Markdown

Daisytuner Report - python_npbench (zinnia)

@@                                            Benchmarks                                            @@
=======================================================================================================
  Benchmark              Speedup (Time) ±%           Energy      Regions   Types (M/F/R/O)   % Peak    
=======================================================================================================
# adi                    
#   numpy                119.00 ms                   11.82 J     —         —                 N/A       
#   docc-sequential      2.27x (52.52 ms)            8.43 J      2         1M 1F             1%        
#   docc-omp             2.06x (57.88 ms)            8.74 J      2         1M 1F             1%        
#   docc-cuda            2.46x (48.34 ms)            4.80 J      6         1M 1F             1%        
# atax                   
#   numpy                46.22 ms                    8.59 J      —         —                 N/A       
#   docc-sequential      2.63x (17.57 ms)            3.74 J      3         1M                1%        
#   docc-omp             2.03x (22.79 ms)            4.91 J      3         1M                0%        
#   docc-cuda            1.52x (30.37 ms)            3.06 J      6         2M                N/A       
# gemm                   
#   numpy                92.87 ms                    18.38 J     —         —                 N/A       
#   docc-sequential      3.67x (25.34 ms)            7.25 J      1         —                 N/A       
#   docc-omp             3.65x (25.42 ms)            7.24 J      1         —                 N/A       
#   docc-cuda            0.12x (752.25 ms)           74.28 J     1         —                 N/A       
# gesummv                
#   numpy                119.33 ms                   20.91 J     —         —                 N/A       
#   docc-sequential      0.68x (174.53 ms)           33.06 J     5         3M                3%        
#   docc-omp             1.73x (69.05 ms)            14.82 J     5         3M                0%        
#   docc-cuda            6.08x (19.61 ms)            2.00 J      10        4M                N/A       
# gemver                 
#   numpy                89.59 ms                    16.20 J     —         —                 N/A       
#   docc-sequential      10.50x (8.53 ms)            1.79 J      7         3M                1%        
#   docc-omp             5.63x (15.93 ms)            3.33 J      7         3M                0%        
#   docc-cuda            7.25x (12.35 ms)            1.29 J      12        6M                N/A       
# k2mm                   
#   numpy                96.57 ms                    19.41 J     —         —                 N/A       
#   docc-sequential      0.71x (135.25 ms)           24.61 J     3         1M                3%        
#   docc-omp             0.71x (135.74 ms)           26.75 J     3         1M                0%        
#   docc-cuda            0.12x (820.35 ms)           81.01 J     7         1M                N/A       
# k3mm                   
#   numpy                74.80 ms                    17.48 J     —         —                 N/A       
#   docc-sequential      0.24x (307.17 ms)           50.54 J     4         1M                4%        
#   docc-omp             0.23x (332.07 ms)           57.47 J     4         1M                0%        
#   docc-cuda            0.06x (1.30 s)              128.42 J    8         1M                N/A       
# mvt                    
#   numpy                50.61 ms                    9.63 J      —         —                 N/A       
#   docc-sequential      2.76x (18.33 ms)            3.83 J      2         —                 N/A       
#   docc-omp             2.75x (18.39 ms)            3.85 J      2         —                 N/A       
#   docc-cuda            1.66x (30.48 ms)            3.07 J      1         1M                N/A       
# symm                   
#   numpy                63.80 ms                    6.34 J      —         —                 N/A       
#   docc-sequential      4.31x (14.81 ms)            3.17 J      3         2M 1F             3%        
#   docc-omp             3.55x (18.00 ms)            4.00 J      3         2M 1F             2%        
# syr2k                  
#   numpy                74.61 ms                    7.44 J      —         —                 N/A       
#   docc-sequential      2.02x (36.91 ms)            7.46 J      1         1F                0%        
#   docc-omp             2.07x (36.05 ms)            7.17 J      1         1F                0%        
#   docc-cuda            2.52x (29.60 ms)            2.97 J      1         1F                1%        
# syrk                   
#   numpy                62.94 ms                    6.25 J      —         —                 N/A       
#   docc-sequential      2.40x (26.17 ms)            5.31 J      1         1F                1%        
#   docc-omp             2.36x (26.62 ms)            5.33 J      1         1F                1%        
#   docc-cuda            2.78x (22.65 ms)            2.29 J      1         1F                1%        
# trmm                   
#   numpy                70.98 ms                    7.13 J      —         —                 N/A       
#   docc-sequential      4.93x (14.39 ms)            3.02 J      3         2M 1F             14%       
#   docc-omp             3.89x (18.23 ms)            3.90 J      3         2M 1F             7%        

@daisytuner

daisytuner Bot commented Jul 24, 2026

Copy link
Copy Markdown

Daisytuner Report - mlir_torch_models (chamomile)

@@                                            Benchmarks                                            @@
=======================================================================================================
  Benchmark              Speedup (Time) ±%           Energy      Regions   Types (M/F/R/O)   % Peak    
=======================================================================================================
# resnet18               
#   torch                90.91 ms                    23.42 J     —         —                 N/A       
#   torch-cuda           18.29 ms                    3.68 J      —         —                 N/A       
#   docc-omp             0.14x (649.53 ms)           207.84 J    45        44M               24%       
#   docc-cuda            0.36x (51.26 ms)            9.74 J      101       72M               N/A       
# segformer              
#   torch-cuda           38.43 ms                    7.56 J      —         —                 N/A       
#   docc-cuda            0.28x (139.06 ms)           26.63 J     435       337M              N/A       

NoraHagmeyer
NoraHagmeyer previously approved these changes Jul 27, 2026

@Moehre2 Moehre2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix and/or adapt the verifiers of llvm/integration/polybench_sequential_test.py

@NoraHagmeyer

Copy link
Copy Markdown
Contributor

Needs a rebase

…gPass for llvm frontend

 * dot_viz sorts edges deterministically. Makes .dot files more deterministic
 + Context can also produce a shared_ptr of the context
 + RPCNodeTransform can optionally dump the cutout and response into sub-folders for debugging (default off, using output_dir metadata on sdfg)
 * updated llvm frontend to use DoccTargets and construct RpcLoopScheduler fresh when needed
 * updated llvm frontend to use the docc context for access to DoccTargets (no it vectorizes again)
 + added "applied_to_element_id" field to RPCNodeTransform reporting, so that we can identify which level of a loop nest was actually tuned
 ~ replaced global PassReportCollector with thread-safe management that creates reports per module.
… then SDFG element counts to not hide correctness issues behind SDFG changes

 * updated llvm poly openmp verifiers: now, with enabled vectorization a portion of "SEQUENTIAL"s have become "VECTORIZE"
 * added result tolerances of 1e8 to openmp durbin, gramschidt and ludcmp

@Atrisan Atrisan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifier update for polybench sequential is missing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not delete the file if its basically empty now

@ramonwirsch
ramonwirsch marked this pull request as draft July 29, 2026 07:34
@NoraHagmeyer NoraHagmeyer mentioned this pull request Jul 29, 2026
25 tasks
@ramonwirsch ramonwirsch changed the title Llvm stability Reduce variability between compile outputs and transfertuning requests Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants