- 
                Notifications
    
You must be signed in to change notification settings  - Fork 14
 
Fix operation filtering and integrate KernelAgent with BackendBench test cases #111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            Laurawly
  wants to merge
  19
  commits into
  main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
fix-kernelagent-tests
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from 6 commits
      Commits
    
    
            Show all changes
          
          
            19 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      5b57a8c
              
                feat: Integrate KernelAgent with BackendBench test cases
              
              
                Laurawly ca194c8
              
                fix: Change filter logic to use exact operation name matching
              
              
                Laurawly 8ba8bd3
              
                feat: Add enhanced KernelAgent run scripts with result organization
              
              
                Laurawly 9084d45
              
                style: Run ruff format on core_torchbench_ops.py
              
              
                Laurawly 58ed0a7
              
                style: Run ruff format on kernel_agent.py and data_loaders.py
              
              
                Laurawly 3f5d5a6
              
                chore: Add license header to core_torchbench_ops.py
              
              
                Laurawly 96f2727
              
                refactor: Address PR reviews - use PR #90 directory structure
              
              
                Laurawly d38491c
              
                feat: Add score tracking to run_kernel_agent.py
              
              
                Laurawly e7050c0
              
                feat: Add FP16/BF16 filtering and Triton-friendly operation classific…
              
              
                Laurawly ea45857
              
                feat: Complete TorchBench operation categorization and KernelAgent in…
              
              
                Laurawly 5dafec7
              
                Merge main branch: Add verbose mode and untestable operators
              
              
                Laurawly 061b57c
              
                fix: Correct syntax error after merge
              
              
                Laurawly a7fc8dc
              
                feat: Use BackendBench serialization format for KernelAgent test gene…
              
              
                Laurawly 8af16e7
              
                feat: Add KernelAgent-generated Triton kernels for 43 operations
              
              
                Laurawly c400448
              
                refactor: Remove README.md files from generated kernel folders
              
              
                Laurawly bca3ec4
              
                more ops added
              
              
                Laurawly 57a3e8a
              
                Merge fix-kernelagent-tests: Resolve conflicts in hardswish and maxim…
              
              
                Laurawly 8cd28d8
              
                Remove multi-version kernel implementations
              
              
                Laurawly 22783ad
              
                feat: Add 26 new KernelAgent-generated Triton kernels
              
              
                Laurawly File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| # All rights reserved. | ||
| # | ||
| # This source code is licensed under the BSD 3-Clause license found in the | ||
| # LICENSE file in the root directory of this source tree. | ||
| 
     | 
||
| """ | ||
                
      
                  Laurawly marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||
| The 77 core PyTorch operators that appear in TorchBench traces. | ||
| These are the high-priority operations for KernelAgent's first release. | ||
| """ | ||
| 
     | 
||
| CORE_TORCHBENCH_OPS = [ | ||
| "abs", | ||
| "_adaptive_avg_pool2d", | ||
| "_adaptive_avg_pool2d_backward", | ||
| "add", | ||
| "addmm", | ||
| "any", | ||
| "avg_pool2d", | ||
| "avg_pool2d_backward", | ||
| "bitwise_and", | ||
| "bitwise_not", | ||
| "bitwise_xor", | ||
| "bmm", | ||
| "cat", | ||
| "clamp", | ||
| "clone", | ||
| "col2im", | ||
| "constant_pad_nd", | ||
| "convolution", | ||
| "convolution_backward", | ||
| "cos", | ||
| "cumsum", | ||
| "div", | ||
| "elu", | ||
| "eq", | ||
| "erf", | ||
| "exp", | ||
| "flip", | ||
| "floor", | ||
| "fmod", | ||
| "ge", | ||
| "gelu", | ||
| "grid_sampler_2d", | ||
| "gt", | ||
| "hardtanh", | ||
| "isinf", | ||
| "isnan", | ||
| "le", | ||
| "leaky_relu", | ||
| "log2", | ||
| "_log_softmax", | ||
| "lt", | ||
| "max", | ||
| "maximum", | ||
| "max_pool2d_with_indices", | ||
| "max_pool2d_with_indices_backward", | ||
| "mean", | ||
| "min", | ||
| "minimum", | ||
| "mm", | ||
| "mul", | ||
| "native_group_norm", | ||
| "native_group_norm_backward", | ||
| "native_layer_norm", | ||
| "ne", | ||
| "neg", | ||
| "nonzero", | ||
| "pow", | ||
| "reciprocal", | ||
| "reflection_pad2d", | ||
| "relu", | ||
| "remainder", | ||
| "repeat", | ||
| "round", | ||
| "rsqrt", | ||
| "sigmoid", | ||
| "sin", | ||
| "_softmax", | ||
| "split_with_sizes", | ||
| "sqrt", | ||
| "sub", | ||
| "sum", | ||
| "tanh", | ||
| "_to_copy", | ||
| "topk", | ||
| "upsample_bilinear2d", | ||
| "upsample_nearest2d", | ||
| "where", | ||
| ] | ||
| 
     | 
||
| # Some of these ops might have variants or different names in the actual op registry | ||
| # This mapping helps handle common variations | ||
| OP_NAME_VARIATIONS = { | ||
                
      
                  Laurawly marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||
| "_adaptive_avg_pool2d": ["adaptive_avg_pool2d"], | ||
| "_adaptive_avg_pool2d_backward": ["adaptive_avg_pool2d_backward"], | ||
| "_log_softmax": ["log_softmax"], | ||
| "_softmax": ["softmax"], | ||
| "_to_copy": ["to_copy", "to"], | ||
| } | ||
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.