google / google/gvisor

Report AVX512_BF16 support in CPUID features

Open
#10,991 2 comments 1 reaction 1 assignee Claimed by @jseba View on GitHub
type: enhancement
Dominant language
Go
Stars
19.3k
Forks
2k
Avg merge
3d 5h
Merged PRs (30d)
264

Description

### Description

We've been doing some performance analysis and have noticed that on bare-metal, a PyTorch image conversion from RGB to YUV will take over 1s for a sample image and on bare-metal it takes less than 50ms. This is fully on the CPU, no CUDA involved. I'm not super familiar with the CPU features that PyTorch uses or how to profile it, but looking at the CPU flags reported via `/proc/cpuinfo` on the host with what gVisor is reporting, the big missing AVX512 flag I'm seeing is for bfloat16 support, `avx512_bf16`.

From what I can tell reading the Intel manual, this flag is in the Structured Extended Feature Enumeration Sub-leaf, where EAX=0x07H and ECX=1 and Linux calls this block 12. I don't see support in `features_amd64.go` for this block at all and am wondering if there's already a tracking ticket for surfacing bf16 support in gVisor or a reason it's not supported (beyond just "hasn't been done yet" 😄).

I can take a pass at implementing it if there's any advice around adding entire new blocks, especially when it looks like there's a gap going from block 7 to block 12.

### Is this feature related to a specific bug?

_No response_

### Do you have a specific solution in mind?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.