Skip to content

[WIP] PrismML Bonsai model support - #45157

Closed
Qubitium wants to merge 6 commits into
huggingface:mainfrom
Qubitium:prism
Closed

Qubitium wants to merge 6 commits into
huggingface:mainfrom
Qubitium:prism

Conversation

@Qubitium

@Qubitium Qubitium commented Apr 1, 2026 •

Copy link
Copy Markdown
Contributor

CI

What does this PR do?

Add PrismML 1bit (gguf based, group-size 128) model inference suppport.

Code Agent Policy

  • I confirm that this is not a pure code agent PR.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

Who can review?

Someone, just not yet. ..WIP

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution 🤗!

CI Security Gate — automatic approval blocked

This PR was not automatically approved for CI because the security gate failed.

Possible reasons:

  • The PR touches 50 or more files — only PRs with fewer than 50 changed files are automatically approved
  • A changed file is outside the allowed directories (src/, tests/, docs/, utils/), has a disallowed extension (only .py, .txt, .md permitted outside tests/ and docs/), or is not .md/.yml inside docs/
  • A new high-severity security issue was detected in the changed Python files (Bandit check)

See the workflow run for the exact violations.

A maintainer can review and manually approve CI if a finding is a false positive.

@Rocketknight1

Copy link
Copy Markdown
Member

cc @SunMarc

@github-actions

Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: ggml

@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 29571866748
Result: failure | Grafana metrics are not available yet.

Code quality check failed: test jobs were skipped. Fix the code quality issues and push again to run tests.

Comment on lines +86 to +96
def _version_meets_minimum(is_available: bool, package_version: str, min_version: str) -> bool:
if not is_available:
return False

try:
return version.parse(package_version) >= version.parse(min_version)
except version.InvalidVersion:
logger.debug(f"Skipping optional package with invalid version string: {package_version!r}")
return False


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why touch this ? what issues are you getting with the previous behavior ?

@Qubitium Qubitium Jul 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SunMarc @Rocketknight1 This WIP PR is no longer needed. It was previously written assuming we (gpt-qmodel) would use the hf gguf bindings to load prism model for infernce so I try to push as much up-stream as possible. But since then, I have decided to re-implement the prism gguf specific kernel for cuda (1/2 bit) so there is no need to patch or depend on HF. I apologize as I have totally forgotten about this PR. Will close it for now.

Comment on lines +92 to +100
def _dequantize_gguf_tensor(data: np.ndarray, tensor_type, dequantize_fn) -> np.ndarray:
try:
return dequantize_fn(data, tensor_type)
except NotImplementedError:
if _is_prism_q1_0_g128(tensor_type):
return _dequantize_prism_q1_0_g128(data)
raise


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not ideal to have this. can't we have it in dequantize ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

@Qubitium Qubitium closed this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants