File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed 
modelopt/onnx/quantization Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ def _make_constant(
4848    setattr (t , "explicit_dtype" , dtype )
4949    return  t 
5050
51+ 
5152def  _make_variable (
5253    name : str , dtype : onnx .TensorProto .DataType , shape : Sequence [int  |  str ]
5354) ->  gs .Constant :
Original file line number Diff line number Diff line change 9898# supported and working 
9999CLIP_MIN  =  1e-5 
100100
101+ 
101102def  safe_cupy_array (tensor ):
102103    """Convert ml_dtypes.int4 tensor to numpy.int8 for CuPy compatibility. 
103104
@@ -304,7 +305,10 @@ def quantize_rtn(
304305
305306        if  gather_w_map  is  not   None :
306307            assert  gather_s_map  is  not   None , "scale-map not found for quantizable gather nodes" 
307-             gather_dq_node_attributes  =  {"axis" : gather_quantize_axis , "block_size" : gather_block_size }
308+             gather_dq_node_attributes  =  {
309+                 "axis" : gather_quantize_axis ,
310+                 "block_size" : gather_block_size ,
311+             }
308312            qdq .insert_dq_nodes (
309313                graph ,
310314                gather_s_map ,
@@ -330,6 +334,7 @@ def quantize_rtn(
330334
331335    return  model 
332336
337+ 
333338class  AWQClipHelper :
334339    """AWQ calibration helper class.""" 
335340
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments