[torch.compile] Compile CustomOp.forward_native for ReLU^2 to avoid raw torch ops inside opaque custom ops (#50244)
Signed-off-by: Roi Koren <roik@nvidia.com>
This commit is contained in:
@@ -658,8 +658,8 @@ class ReLUSquaredActivation(CustomOp):
|
||||
|
||||
# --8<-- [end:relu2]
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
def __init__(self, *, compile_native: bool = True):
|
||||
super().__init__(compile_native=compile_native)
|
||||
if current_platform.is_cuda_alike():
|
||||
self.op = torch.ops._C.relu_squared
|
||||
|
||||
|
||||
Reference in New Issue
Block a user