update batch kernel condition (#12421)
This commit is contained in:
		
							parent
							
								
									7288c759ce
								
							
						
					
					
						commit
						145e8b480f
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
					@ -362,14 +362,22 @@ def use_batch_forward(x: torch.Tensor, qtype: int, output_len: int):
 | 
				
			||||||
    batch_size = x.shape[0]
 | 
					    batch_size = x.shape[0]
 | 
				
			||||||
    hard_condition = (
 | 
					    hard_condition = (
 | 
				
			||||||
        x.dtype in [torch.float, torch.half]
 | 
					        x.dtype in [torch.float, torch.half]
 | 
				
			||||||
        and batch_size <= 48
 | 
					        and x.shape[1] % 128 == 0
 | 
				
			||||||
        and (
 | 
					        and (
 | 
				
			||||||
            (
 | 
					            (
 | 
				
			||||||
                qtype in [SYM_INT4, ASYM_INT4, FP8E5, FP8E4]
 | 
					                qtype in [SYM_INT4, ASYM_INT4, FP8E5, FP8E4]
 | 
				
			||||||
                and x.shape[1] % 128 == 0
 | 
					                and (
 | 
				
			||||||
 | 
					                    batch_size <= 48
 | 
				
			||||||
 | 
					                    or (
 | 
				
			||||||
 | 
					                        batch_size <= 64
 | 
				
			||||||
 | 
					                        and x.shape[1] % 256 == 0
 | 
				
			||||||
 | 
					                        and output_len % 64 == 0
 | 
				
			||||||
 | 
					                    )
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            or (
 | 
					            or (
 | 
				
			||||||
                qtype in [SYM_INT8, FP4, FP6, Q4_K, Q6_K]
 | 
					                qtype in [SYM_INT8, FP4, FP6, Q4_K, Q6_K]
 | 
				
			||||||
 | 
					                and batch_size <= 48
 | 
				
			||||||
                and device in ["arc", "flex", "pvc", "mtl"]
 | 
					                and device in ["arc", "flex", "pvc", "mtl"]
 | 
				
			||||||
                and x.shape[1] % 256 == 0
 | 
					                and x.shape[1] % 256 == 0
 | 
				
			||||||
                and output_len % 32 == 0
 | 
					                and output_len % 32 == 0
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue