File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -440,6 +440,11 @@ def dequantize_4bit_impl(
440440    if  quant_state .nested :
441441        raise  NotImplementedError ("bnb_4bit_use_double_quant is not supported yet for CPU/XPU" )
442442
443+     if  ipex_cpu  and  _ipex_cpu_version_prereq (2 , 3 ) and  hasattr (quant_state , "op_context" ):
444+         assert  quant_state .op_context  is  not   None 
445+         A  =  quant_state .op_context .to_public (quant_state .op_context .get_weight ())
446+         A  =  A .reshape (- 1 )
447+ 
443448    if  out  is  None :
444449        out  =  torch .empty (quant_state .shape , dtype = quant_state .dtype , device = A .device )
445450
@@ -503,7 +508,7 @@ def gemm_4bit_impl(
503508    torch.Tensor: 
504509        GEMM output tensor. 
505510    """ 
506-     if  ipex_cpu  and  _ipex_cpu_version_prereq (2 , 2 ) and  hasattr (state , "op_context" ):
511+     if  ipex_cpu  and  _ipex_cpu_version_prereq (2 , 3 ) and  hasattr (state , "op_context" ):
507512        assert  state .op_context  is  not   None 
508513        output  =  torch .ops .torch_ipex .ipex_woq_linear (A , state .op_context .get_data_handle ())
509514    else :
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments