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

allow disable cpu flags #782

Open
Chizkiyahu opened this issue Jan 30, 2025 · 10 comments
Open

allow disable cpu flags #782

Chizkiyahu opened this issue Jan 30, 2025 · 10 comments
Assignees
Labels
community_new New idea raised by a community contributor

Comments

@Chizkiyahu
Copy link

Tell us about your request

docker run --cpu-flags or docker run --cpu-disable-flags
allow to disable cpu flags

Which service(s) is this request for?

docker run

Why Is Needed

Macbook pro max m1 - inside of docker

lscpu | grep Flags
Flags:                                fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp flagm2 frint

Macbook pro max m1 - inside of docker

lscpu |  grep Flags
Flags:                                fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm sb paca pacg dcpodp sve2 flagm2 frint svei8mm svebf16 bf16 afp sme

Compare table

Flag M4 M1
fp
asimd
evtstrm
aes
pmull
sha1
sha2
crc32
atomics
fphp
asimdhp
cpuid
asimdrdm
jscvt
fcma
lrcpc
dcpop
sha3
asimddp
sha512
asimdfhm
dit
uscat
ilrcpc
flagm
sb
paca
pacg
dcpodp
sve2
flagm2
frint
svei8mm
svebf16
bf16
afp
sme

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?

Are you currently working around the issue?

I am trying to solve this in the os level or the tensorflow level but without success for now

@Chizkiyahu Chizkiyahu added the community_new New idea raised by a community contributor label Jan 30, 2025
@Chizkiyahu
Copy link
Author

update
I solve my problem in tensorflow level by setting env XLA_FLAGS to value --xla_backend_optimization_level=0
but is probably be valuable to allow this in the docker level

@kasper0406
Copy link

I hit this issue as well, where I was running an XLA model using TFServe in Docker. It got killed due to generating an SVE operation not supported by the processor, due to Docker wrongly claiming the sve2 capability.

@Chizkiyahu
Copy link
Author

I hit this issue as well, where I was running an XLA model using TFServe in Docker. It got killed due to generating an SVE operation not supported by the processor, due to Docker wrongly claiming the sve2 capability.

did XLA_FLAGS flag solved the problem ?

@kasper0406
Copy link

Yes, it did fix it.
There should be a proper fix for this though, which I believe should be that Docker should report the correct capabilities. Otherwise it complicates building docker images for multiple environments, as fx in production, disabling XLA optimizations seems like a bad idea.

@Chizkiyahu
Copy link
Author

I am not sure if this is a docker bug or tensorflow bug or even mac os bug
if you thinks is a docker bug we can open issue in https://github.com/docker/for-mac

@kasper0406
Copy link

I am not expert here, but I think it is a docker bug - it exposes a supported CPU feature set that is actually not supported.

When XLA then jits the model, it will think it’s fine to use the SVE instructions - but it is not!

FWIW I created a question in the XLA discord in case they have thoughts: https://discord.com/channels/999073994483433573/1004823487124357182/1336481646647709847

@Chizkiyahu
Copy link
Author

is look like the same problem
rancher-sandbox/rancher-desktop#8057 (comment)

@Chizkiyahu
Copy link
Author

look like same problem
elastic/elasticsearch#118583

@Chizkiyahu
Copy link
Author

look connected
ClickHouse/ClickHouse#74743

@Chizkiyahu
Copy link
Author

moby/buildkit#5433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_new New idea raised by a community contributor
Projects
None yet
Development

No branches or pull requests

3 participants