File tree 1 file changed +13
-8
lines changed
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change @@ -236,19 +236,24 @@ def register_custom_op(
236
236
device_types : Optional [Union [str , Sequence [str ]]] = None ,
237
237
schema : Optional [str ] = None ,
238
238
) -> Callable :
239
- return torch .library .custom_op (
240
- name ,
241
- fn ,
242
- mutates_args = mutates_args ,
243
- device_types = device_types ,
244
- schema = schema ,
245
- )
239
+ # NOTE(Zihao): torch.library.custom_op has significant overhead as mentioned in the following link
240
+ # https://github.com/vllm-project/vllm/blob/36e76700453924c8d421db99af70a88a1df835cd/vllm/utils.py#L1660-L1674
241
+
242
+ # return torch.library.custom_op(
243
+ # name,
244
+ # fn,
245
+ # mutates_args=mutates_args,
246
+ # device_types=device_types,
247
+ # schema=schema,
248
+ # )
249
+ return lambda x : x
246
250
247
251
def register_fake_op (
248
252
name : str ,
249
253
fn : Optional [Callable ] = None ,
250
254
) -> Callable :
251
- return torch .library .register_fake (name , fn )
255
+ # return torch.library.register_fake(name, fn)
256
+ return lambda x : x
252
257
253
258
254
259
def get_cuda_stream (device : torch .device ) -> int :
You can’t perform that action at this time.
0 commit comments