Skip to content

Refactor feature extractors to match production instruction mix (#705) - #705

Closed
excelle08 wants to merge 2 commits into
facebookresearch:v2-betafrom
excelle08:export-D99494831-to-v2-beta
Closed

Refactor feature extractors to match production instruction mix (#705)#705
excelle08 wants to merge 2 commits into
facebookresearch:v2-betafrom
excelle08:export-D99494831-to-v2-beta

Conversation

@excelle08

@excelle08 excelle08 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary:

Replace scalar FP transforms with integer hash operations, add data-dependent
conditional branches, eliminate FP division with integer reciprocal approximation,
deepen MockHashTable::find() call chain from 1 to 5 levels, and increase basic
block sizes with MurmurHash-style computation chains.

Results (5/7 instruction mix targets met on CPL):

  • Scalar FP: 8% → 0.46% (target <3.5%) ✓
  • Conditional branches: 5.28% → 10.73% (target >15%) ✗
  • Near call/return: 3.93% → 0.75% (target <1.5%) ✓
  • Memory (ld+st): 51.56% → 40.72% (target 40-46%) ✓
  • Divider active: 11.50% → 1.13% (target <2%) ✓
  • Avg BB size: 7.3 → 13.7 (LBR, target >18) ✗

QPS impact: CPL -2.2%, BGM -6.3%, Grace -3.8%.

Reviewed By: charles-typ

Differential Revision: D99494831

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 2, 2026
@meta-codesync

meta-codesync Bot commented Jul 2, 2026

Copy link
Copy Markdown

@excelle08 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D99494831.

excelle08 added a commit to excelle08/DCPerf-1 that referenced this pull request Jul 2, 2026
…bookresearch#705)

Summary:
Pull Request resolved: facebookresearch#705

Replace scalar FP transforms with integer hash operations, add data-dependent
conditional branches, eliminate FP division with integer reciprocal approximation,
deepen MockHashTable::find() call chain from 1 to 5 levels, and increase basic
block sizes with MurmurHash-style computation chains.

Results (5/7 instruction mix targets met on CPL):
- Scalar FP: 8% → 0.46% (target <3.5%) ✓
- Conditional branches: 5.28% → 10.73% (target >15%) ✗
- Near call/return: 3.93% → 0.75% (target <1.5%) ✓
- Memory (ld+st): 51.56% → 40.72% (target 40-46%) ✓
- Divider active: 11.50% → 1.13% (target <2%) ✓
- Avg BB size: 7.3 → 13.7 (LBR, target >18) ✗

QPS impact: CPL -2.2%, BGM -6.3%, Grace -3.8%.

Reviewed By: charles-typ

Differential Revision: D99494831
@excelle08
excelle08 force-pushed the export-D99494831-to-v2-beta branch from 6d26df9 to 7acda54 Compare July 2, 2026 20:13
@meta-codesync meta-codesync Bot changed the title Refactor feature extractors to match production instruction mix Refactor feature extractors to match production instruction mix (#705) Jul 2, 2026
excelle08 added 2 commits July 3, 2026 11:13
Summary:
Add mock feature extraction pipeline to FeedSim with large-scale code
generation for I-cache and frontend pressure. 27 genuinely diverse code
patterns (derived from studying 696 production feature extractors) generate
~700 variants × 1000 copies = ~700K unique functions at install time.

Key components:
- 6 hand-written extractors based on production leaf function profiling
- 27 pattern-specific code generators (P01-P27) producing genuinely
  different instruction sequences (different branch topologies, loop
  nesting, data access patterns, code sizes from 10 to 2300 lines)
- Flat shuffled dispatch: all copy function pointers shuffled into one
  vector, iterated sequentially per request for maximum I-cache pressure
- DLRM medium/large model generation on-server during install
- Configurable via --num_stories, --extractors_per_story, --feature_complexity

Results on T1_BGM (Bergamo, 176 cores):
  500K calls/req: L1 I-Cache MPKI 21.34 (prod target 21), IPC 0.69 (prod 0.6-0.8)
  100K calls/req: Frontend Bound 23.5%, IPC 1.22, QPS 242

Results on T11_GRC_ARM (Grace, 72 cores):
  100K calls/req: IPC 0.52, L1 I-Cache MPKI 15.91
  Medium DLRM + 100K calls: IPC 1.03 (prod target 1.05)

Differential Revision: D97022149
…bookresearch#705)

Summary:
Pull Request resolved: facebookresearch#705

Replace scalar FP transforms with integer hash operations, add data-dependent
conditional branches, eliminate FP division with integer reciprocal approximation,
deepen MockHashTable::find() call chain from 1 to 5 levels, and increase basic
block sizes with MurmurHash-style computation chains.

Results (5/7 instruction mix targets met on CPL):
- Scalar FP: 8% → 0.46% (target <3.5%) ✓
- Conditional branches: 5.28% → 10.73% (target >15%) ✗
- Near call/return: 3.93% → 0.75% (target <1.5%) ✓
- Memory (ld+st): 51.56% → 40.72% (target 40-46%) ✓
- Divider active: 11.50% → 1.13% (target <2%) ✓
- Avg BB size: 7.3 → 13.7 (LBR, target >18) ✗

QPS impact: CPL -2.2%, BGM -6.3%, Grace -3.8%.

Reviewed By: charles-typ

Differential Revision: D99494831
@excelle08
excelle08 force-pushed the export-D99494831-to-v2-beta branch from 7acda54 to 465ad80 Compare July 3, 2026 18:19
meta-codesync Bot pushed a commit that referenced this pull request Jul 4, 2026
Summary:
Pull Request resolved: #705

Replace scalar FP transforms with integer hash operations, add data-dependent
conditional branches, eliminate FP division with integer reciprocal approximation,
deepen MockHashTable::find() call chain from 1 to 5 levels, and increase basic
block sizes with MurmurHash-style computation chains.

Results (5/7 instruction mix targets met on CPL):
- Scalar FP: 8% → 0.46% (target <3.5%) ✓
- Conditional branches: 5.28% → 10.73% (target >15%) ✗
- Near call/return: 3.93% → 0.75% (target <1.5%) ✓
- Memory (ld+st): 51.56% → 40.72% (target 40-46%) ✓
- Divider active: 11.50% → 1.13% (target <2%) ✓
- Avg BB size: 7.3 → 13.7 (LBR, target >18) ✗

QPS impact: CPL -2.2%, BGM -6.3%, Grace -3.8%.

Reviewed By: charles-typ

Differential Revision: D99494831

fbshipit-source-id: dba6926afe8c0dfb4efed7a0006cfcf62b2268b1
@excelle08 excelle08 closed this Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant