Skip to content

HGQ v2 support (part 1)#1154

Closed
calad0i wants to merge 69 commits intofastmachinelearning:mainfrom
calad0i:s-quark-pr
Closed

HGQ v2 support (part 1)#1154
calad0i wants to merge 69 commits intofastmachinelearning:mainfrom
calad0i:s-quark-pr

Conversation

@calad0i
Copy link
Contributor

@calad0i calad0i commented Dec 17, 2024

Description

Preliminary support for the HGQ v2 package. Adds corresponding handlers, bit-exact optimizer, and layer implementations.

Includes the following:

  • Keras v3 support ✅
    • Object based parser (and supports reused layers) ✅
    • Layer handlers for incompatible layers ⚠️
    • Make QKeras optional ✅
      • Lazy converter import ✅
  • MultiHeadAttention (✅ parallel, stream ❌)
    • EinsumDense (parallel ✅, stream ❌)
      • General transpose (parallel ✅ stream ⚠️)
    • Einsum ✅
    • Bit-exact softmax ✅
    • Multi-dimentional softmax (parallel ✅ stream ❌)
    • (?) cossim based attn
  • Automatic precision config
    • accum_t precision inference ✅
      • Symbolic precision converter (fixed ✅ minifloat ❌)
        • const_arr/precision_arr +-*@ precision_arr -> precision_arr
      • Support for specific layers (everything in HGQ v1 + alpha) ✅
    • Fuse RND into bias and cast to TRN when possible
  • minifloat support ❌
    • minifloat * minifloat -> fixed_point cpp template
      • Check if the compiler is smart enough
      • Precision conversion rules

Type of change

  • New frontend and features

Tests

N/A at the moment, not possible w/o test env update.
Bit-exact logic supersedes HGQ proxy embedding configs, thus those tests are reused w/o need of modification.

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have installed and run pre-commit on the files I edited or added.
  • I have added tests that prove my fix is effective or that my feature works.

@calad0i calad0i changed the title [DRAFT] s-quaark support [DRAFT] s-quark support Dec 17, 2024
@calad0i calad0i changed the title [DRAFT] s-quark support s-quark support Jan 23, 2025
@calad0i calad0i changed the title s-quark support preliminary s-quark support Jan 23, 2025
@calad0i calad0i added please test Trigger testing by creating local PR branch and removed please test Trigger testing by creating local PR branch labels Jan 23, 2025
@calad0i calad0i added the please test Trigger testing by creating local PR branch label Jan 23, 2025
@calad0i calad0i changed the title preliminary s-quark support HGQ v2 support (part 1) Feb 21, 2025
@vloncar vloncar closed this Jun 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

please test Trigger testing by creating local PR branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants