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

feat(frontend): warn if aes cpu flag isn't available #770

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

youben11
Copy link
Member

@youben11 youben11 commented Apr 2, 2024

No description provided.

@cla-bot cla-bot bot added the cla-signed label Apr 2, 2024
from cpuinfo import get_cpu_info

def _is_cpu_compatible() -> bool:
"""Check if CPU can run Concrete
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe
CPU has AES instruction
they can still run compilation ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Still not sure to check for aes only

bool: if the CPU does support required features to run Concrete
"""
flags = get_cpu_info()["flags"]
if "aes" in flags:
Copy link
Contributor

Choose a reason for hiding this comment

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

return "aes" in flags

return False

# Print a warning if the CPU can't run Concrete
if not _is_cpu_compatible():
Copy link
Contributor

Choose a reason for hiding this comment

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

why at top level ?
can't they at least compile but not run ?
if the case, maybe the warning should be an error when calling a circuit execution.
and onluy a warning when calling compilation

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea is to show a warning whenever you import concrete. It take some time to run so I'm not sure about adding it as part of the execution call

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

Successfully merging this pull request may close these issues.

None yet

2 participants