-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow exporting decoder models using optimum-cli #422
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
a00d425
to
0e705d2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be add a test for it?
I thought I did add one, but I might have dreamed it, or I lost it in my rebase ... |
Done. |
# If the sequence_length was not specified, deduce it from the model configuration | ||
if sequence_length is None: | ||
# Note: for older models, max_position_embeddings is an alias for n_positions | ||
sequence_length = config.max_position_embeddings | ||
if num_cores is None: | ||
# Use all available cores | ||
num_cores = len(os.listdir("/sys/class/neuron_device/")) * 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail if the directory does not exist. Are we sure that this code can only be executed on a machine that has neuron devices?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a check on top of the function. It is not possible to instantiate the transformers-neuronx
model otherwise.
Co-authored-by: Michael Benayoun <mickbenayoun@gmail.com>
70c4da9
to
c4fdaec
Compare
A long awaited feature ... it is now possible to export decoder models just like any other models using the optimum-cli.