Repository navigation
feat(adapters): accept probe slots in Granite Switch checkpoints - #1797
Merged
planetf1 merged 5 commits intoNov 16, 2026
Merged
Conversation
Discovery only accepted `technology` lora and alora, so one probe entry in adapter_index.json made it raise and no adapter on the checkpoint loaded. Accept `probe` and register it as LoRA; its first_token io.yaml uses the existing one-token readout. Skip other unknown technologies with a warning so the remaining adapters still load. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
planetf1
force-pushed
the
dev/jonesn/switch-probes
branch
from
November 6, 2026 19:20
2f78206 to
c6735b3
Compare
A Granite Switch index can carry an unsupported slot (for example technology "sr") that publishes no io.yaml. Local discovery skipped such a slot before reading its config, but Hub materialisation resolved every entry's io_config first, so from_hub failed with a misleading "adapter_index.json was not found in the downloaded snapshot". Share one technology filter across both paths, and make it reject a non-string technology value instead of raising TypeError. Also document that a probe slot must keep its own adapter function name, since the output contract is keyed by name, and add a label-order test pinning probe polarity to the checkpoint's io.yaml rather than to code. Assisted-by: pi Signed-off-by: Nigel Jones <[email protected]>
Signed-off-by: Nigel Jones <[email protected]> # Conflicts: # docs/examples/granite-switch/README.md
Upstream removed the deprecated EmbeddedIntrinsicAdapter shim (generative-computing#1821). Port the probe-slot support and unsupported-technology skipping to _embedded_adapter_from_entry, _embedded_adapters_from_model_directory and _embedded_adapters_from_hub, and update the tests to that API. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
The earlier upstream merge dropped the Granite Switch README's probe section when generative-computing#1765 restructured it, and the shim removal took test_probe_technology_registers_as_lora with EmbeddedIntrinsicAdapter. Restore both against _embedded_adapter_from_entry. Assisted-by: Claude Code Signed-off-by: Nigel Jones <[email protected]>
spzala
approved these changes
Nov 16, 2026
spzala
left a comment
Contributor
There was a problem hiding this comment.
@planetf1 nice, lgtm!! The only comment I have is that we should add some of the new term added here (e.g. probe) in the glossary similar to lora and alora. Since, it’s something that can be done separately, unless you want to cover it, I will open an issue and work on it if that sounds good? Thanks!
Merged
via the queue into
generative-computing:main
with commit Nov 16, 2026
3b32508
16 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Issue
Related to #1741
Description
Before: if a Granite Switch checkpoint contained a probe slot, Mellea failed to load any of its adapter functions.
After: probe slots load alongside the LoRA and aLoRA ones, and you can call them directly:
A probe is a classifier head that answers with a single label token. Existing checkpoints are unaffected.
Details
technology: probeinadapter_index.jsonis accepted and registered as LoRA. Itsfirst_tokenio.yaml is read by the existing one-token readout.technologyis skipped with a warning, so the remaining adapters still load.<name>_probe); reusing a generative capability's name would apply that capability's output schema to the one-token readout.io.yamlstill loads; materialisation applies the same technology filter as local discovery.Implementation
Built on the composed-adapter discovery from #1821 (shim removal):
_embedded_adapter_from_entrymapsprobeto LoRA, and both_embedded_adapters_from_model_directoryand_embedded_adapters_from_hubskip an unsupported slot before resolving its
io_config.Not included in this PR
rag.*,guardian.*) don't route to probes; using one still means invoking it by name (e.g.answerability_probe). Whether a helper should prefer a probe over its generative adapter is a follow-on discussion, so this PR leaves helper behaviour unchanged.identity.adapter_type("lora"), droppingtechnology. A follow-on that routes by adapter technology first needs a first-class representation (AdapterType.PROBE, or a retained technology field).KeyError, without the reason that_adapter_skip_reasonsadds for an invalid decision config. Follow-up: feat(adapters): report unsupported-technology skips in the adapter not-found error #1837.granite-switch-4.1-*-previewrepos has one inadapter_index.json), so probe behaviour is not exercised end to end against a published model.Testing
Unit tests cover a probe slot, a mixed lora/probe/unknown index, the Hub materialisation path with an unsupported slot that has no
io.yaml, acall_intrinsicprobe call on a canned response, and a label-order case (labels: ["yes", "no"]) pinning probe polarity to the checkpoint'sio.yamlrather than to code. Backend and adapter-function unit suites pass (1542 passed, 47 skipped), and all five publishedgranite-switch-4.1-*checkpoints still register every slot in theiradapter_index.json.Attribution
Adding a new component, requirement, sampling strategy, or tool?
If your PR adds or modifies one of the types below, check the matching box. A checklist of type-specific review items will be posted as a comment.
NOTE: Please ensure you have an issue that has been acknowledged by a core contributor and routed you to open a pull request against this repository. Otherwise, please open an issue before continuing with this pull request.