You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to do a sequencing run using a compiled Casanovo model I encountered this runtime error:
...
torch._dynamo.exc.TorchRuntimeError: Failed running call_module L__self___encoder_transformer_encoder(*(FakeTensor(..., device='cuda:0', size=(128, 121, 512)),), **{'src_key_padding_mask': FakeTensor(..., device='cuda:0', size=(128, 121), dtype=torch.bool)}):
strided nested tensors are not supported by meta conversion
from user code:
File "C:\Users\gavin\OneDrive\Documents\casanovo\casanovo\denovo\model.py", line 844, in predict_step
self.forward(batch[0], batch[1]),
File "C:\Users\gavin\OneDrive\Documents\casanovo\casanovo\denovo\model.py", line 210, in forward
return self.beam_search_decode(
File "C:\Users\gavin\OneDrive\Documents\casanovo\casanovo\denovo\model.py", line 240, in beam_search_decode
memories, mem_masks = self.encoder(spectra)
File "D:\anaconda3\envs\casanovo_env\lib\site-packages\torch\nn\modules\module.py", line 1541, in _call_impl
return forward_call(*args, **kwargs)
File "D:\anaconda3\envs\casanovo_env\lib\site-packages\depthcharge\components\transformers.py", line 105, in forward
return self.transformer_encoder(peaks, src_key_padding_mask=mask), mask
When attempting to do a sequencing run using a compiled Casanovo model I encountered this runtime error:
From the best I can tell this specific error is an issue with PyTorch's built-in
TransformerEncoder
module, which is known to be incompatible with torch.compile: https://discuss.pytorch.org/t/runtime-error-when-running-inference-on-a-compiled-nn-transformerencoder/198010In order to run with a compiled Casanovo model I added
self.model = torch.compile(self.model)
to the end ofModelRunner.initialize_model
.From my understanding making the Casanovo model compatible with torch.compile would be useful for addressing #328.
The text was updated successfully, but these errors were encountered: