Skip to content

fix: calculate apic_bits using maximum thread index#399

Open
Yassin-pixel-bit wants to merge 1 commit into
pytorch:mainfrom
Yassin-pixel-bit:fix/wrong_cache_count
Open

fix: calculate apic_bits using maximum thread index#399
Yassin-pixel-bit wants to merge 1 commit into
pytorch:mainfrom
Yassin-pixel-bit:fix/wrong_cache_count

Conversation

@Yassin-pixel-bit

Copy link
Copy Markdown

Previously, the bitmask length for SMT cache grouping used the total core count. For a 2-thread cache, bit_length(2) allocated 2 bits, creating a mask that grouped 4 threads together. Changing this to bit_length(cores - 1) allocates exactly 1 bit, correctly masking 2 threads per cache instance.

fixes: #396

Previously, the bitmask length for SMT cache grouping used the total core count. For a 2-thread cache, bit_length(2) allocated 2 bits, creating a mask that grouped 4 threads together. Changing this to bit_length(cores - 1) allocates exactly 1 bit, correctly masking 2 threads per cache instance.
@meta-cla meta-cla Bot added the cla signed label Jun 28, 2026
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.

Windows: SMT halves L1i/L1d/L2 cache instance count (cache.processor_count doubled)

1 participant