Skip to content

Conversation

@guangy10
Copy link
Contributor

@guangy10 guangy10 commented Oct 15, 2024

Having bos_token_id = None (and other fields) will cause an emitter error for models that doesn't define that field, for example, olmo-1b.

    raise ExportError(
executorch.exir.error.ExportError: [ExportErrorType.NOT_SUPPORTED]: Error emitting get_bos_id which returns a value of type <class 'NoneType'>. which is not a supported primitive

This PR avoids emitting with unsupported primitive type by removing the None fields out from the model metadata. The ExecuTorch runtime will assume the default value for those unspecified fields.

@pytorch-bot
Copy link

pytorch-bot bot commented Oct 15, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/6246

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit e03a61c with merge base 708c6b6 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 15, 2024
@guangy10 guangy10 requested a review from kirklandsign October 15, 2024 23:38
"get_bos_id": model.config.bos_token_id,
"get_eos_id": model.config.eos_token_id,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larryliu0820 Is it safe to leave it unset and let the runtime to use the default value? Or it's preferred to set it to some special value e.g. -1, if any of the field is unset by a model?

@guangy10 guangy10 requested a review from larryliu0820 October 15, 2024 23:38
@facebook-github-bot
Copy link
Contributor

@guangy10 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@guangy10 guangy10 force-pushed the fix_export_hf_script branch from 3ffadda to 1d68171 Compare October 16, 2024 00:14
@facebook-github-bot
Copy link
Contributor

@guangy10 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@guangy10 guangy10 force-pushed the fix_export_hf_script branch from 1d68171 to e03a61c Compare October 16, 2024 17:23
@facebook-github-bot
Copy link
Contributor

@guangy10 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@guangy10 merged this pull request in 0c5536e.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants