Closed MarcusLoppe closed 4 months ago
@MarcusLoppe hello again 😄 not sure what's going on, but i just decided to revert to importing the apply_rotary_pos_emb
function
let me know if that does it!
@MarcusLoppe hello again 😄 not sure what's going on, but i just decided to revert to importing the
apply_rotary_pos_emb
functionlet me know if that does it!
Hiya :)
It's very strange, it didn't work :/
This is probably some python thing with the initializations of the class or what not.
Maybe there is some edge case where referencing the function using self.apply_rotary_pos_emb
isn't working and must be a class object or what not.
Maybe some CUDA hook or whatever is not picking it up? :/
If I run the code outside of MeshGPT it works since it's throwing me a error.
from local_attention.rotary import SinusoidalEmbeddings
test = SinusoidalEmbeddings(dim = 192)
test.apply_rotary_pos_emb()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[7], line 3
1 from local_attention.rotary import SinusoidalEmbeddings
2 te = SinusoidalEmbeddings(dim = 192)
----> 3 te.apply_rotary_pos_emb()
File /opt/conda/lib/python3.10/site-packages/torch/amp/autocast_mode.py:16, in autocast_decorator.<locals>.decorate_autocast(*args, **kwargs)
13 @functools.wraps(func)
14 def decorate_autocast(*args, **kwargs):
15 with autocast_instance:
---> 16 return func(*args, **kwargs)
TypeError: apply_rotary_pos_emb() missing 3 required positional arguments: 'q', 'k', and 'freqs'
@MarcusLoppe ok, that is strange, want to try yet again?
@MarcusLoppe ok, that is strange, want to try yet again?
Nice, all good now. Thank you :) 🚀
@lucidrains
Oh, i just noticed this error when trying to create MeshTransformer.
File /opt/conda/lib/python3.10/site-packages/pytorch_custom_utils/save_load.py:32, in save_load.<locals>._save_load.<locals>.__init__(self, *args, **kwargs)
30 @wraps(_orig_init)
31 def __init__(self, *args, **kwargs):
---> 32 _config = pickle.dumps((args, kwargs))
34 setattr(self, config_instance_var_name, _config)
35 _orig_init(self, *args, **kwargs)
TypeError: cannot pickle 'staticmethod' object
@MarcusLoppe ah ok, i'll just remove the staticmethod altogether, thanks!
During the one of recent commits, the apply_rotary_pos_emb function is expected to exists within the positioning embedding class but since SinusoidalEmbeddings is outside of the class/object it can't be found. When using version 1.9.1 of local attention this error doesn't show up.
I'd recommend moving the apply_rotary_pos_emb so it's within the SinusoidalEmbeddings class.