Skip to content
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

Singlepass artifact cannot be used on a different machine if it has less CpuFeatures #3362

Closed
ptitSeb opened this issue Nov 23, 2022 · 1 comment
Assignees
Labels
🎉 enhancement New feature! priority-medium Medium priority issue
Milestone

Comments

@ptitSeb
Copy link
Contributor

ptitSeb commented Nov 23, 2022

Motivation

Articfacts are saved witht he CpuFeatures of the host machine used for the compilation (wich is a subset of the actual cpu features). When the artifacts is deserialized, that feature set is compared to the new host machine and there is a faillure if the features set don't match.
While it's correct behaviour for Cranelift and LLVM artifacts, bacause the whole cpu feature set can be used, it's too concervative for Singlepass compiler, that will use only a few of the cpufeatures.

Proposed solution

Store the potentialy used subset of cpufeatures in the artifacts. That will not change for Cranelift and LLVM artifacts, but will store only a few for Singlepass (AVX, SSE42 and LZCNT for now).

Note that this should apply only on x86_64 plateform, as ARM64 or other doesn't use cpu feature yet.

@ptitSeb ptitSeb added the 🎉 enhancement New feature! label Nov 23, 2022
@ptitSeb ptitSeb added this to the v3.1 milestone Nov 23, 2022
@ptitSeb ptitSeb self-assigned this Nov 23, 2022
@Michael-F-Bryan Michael-F-Bryan added the priority-medium Medium priority issue label Nov 29, 2022
bors bot added a commit that referenced this issue Nov 30, 2022
3363: Store Used CpuFeature in Artifact instead of Present CpuFeatures for Singlepass r=syrusakbary a=ptitSeb

# Description
Added a function in Compiler trait to list the potentially used CpuFeatures. This is then used when storing the Artifact.
Singlepass compiler only use a handfull of cpufeature on x86_64, so it's usefull there to avoid marking artifact as needing features like AVX512 while it's not used at all.

For #3362 

Co-authored-by: ptitSeb <[email protected]>
@ptitSeb
Copy link
Contributor Author

ptitSeb commented Dec 6, 2022

Merged

@ptitSeb ptitSeb closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature! priority-medium Medium priority issue
Projects
None yet
Development

No branches or pull requests

2 participants