Skip to content

docs(examples): standardize adapter, granite-switch, aLoRA, and SOFAI examples - #1765

Merged
rafvasq merged 5 commits into
generative-computing:mainfrom
rafvasq:docs/adapters-model-capabilities-standardize
Nov 6, 2026
Merged

rafvasq merged 5 commits into
generative-computing:mainfrom
rafvasq:docs/adapters-model-capabilities-standardize

Conversation

@rafvasq

@rafvasq rafvasq commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Pull Request

Issue

Closes #1746

Description

Standardizes intrinsics/, granite-switch/, aLora/, and sofai/, keeping the original docstring and README wording and adding structure.

Docstrings

  • Added docstrings to scripts that had none
  • Added Prerequisites: and Usage: blocks

READMEs

  • Each is now a short description with links to the matching site docs, and includes an ## Examples table, using the original per-file descriptions where they were accurate.
  • Removed content was checked against docs like advanced/intrinsics.md, advanced/lora-and-alora-adapters.md, and advanced/inference-time-scaling.md. Content that isn't covered wasn't removed: the Granite Switch overview, the architecture diagram, and the SOFAI flow diagram.
  • Kept the train/upload/add-readme workflow in aLora/ since no script contains it.

Other fixes

  • Fixed the architecture diagram links in intrinsics/ and granite-switch/. The image moved to docs/static/images/ in docs: migrate from Mintlify to Docusaurus 3 #1174.
  • In aLora/README.md:
    • Fixed the clone URL (missing https://) and quoted ".[all]" so it works in zsh.
    • Added the missing \ in the --hints command.
    • Added the huggingface-cli login prerequisite.
    • Updated "(Adaptive)" to "(Activated)" Low-Rank Adapters.
  • sofai/README.md used parameter names that don't exist (s1_backend, escalate_on_failure). I removed them along with the code sample.
  • Added # pytest: huggingface, e2e to query_rewrite.py, which had no marker.

Testing

  • Tests added to the respective file if code was changed
  • New code has 100% coverage if code was added
  • Ensure existing tests and github automation passes (a maintainer will kick off the github automation when the rest of the PR is populated)

Attribution

  • AI coding assistants used

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.

  • Component
  • Requirement
  • Sampling Strategy
  • Tool

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.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Oct 27, 2026
… examples

Towards generative-computing#1746. Standardize header docstrings (description, Prerequisites, Usage) across intrinsics/, granite-switch/, aLora/, and sofai/. Reduce intri
  nsics/, granite-switch/, and sofai/ READMEs to a description plus an Examples table, linking to the site docs for concepts. Keep the aLoRA train/upload/add-
  readme workflow in its README since no script covers it.

Assisted-by: IBM Bob
Signed-off-by: Rafael Vasquez <[email protected]>
@rafvasq
rafvasq force-pushed the docs/adapters-model-capabilities-standardize branch from 47f3c65 to f66eb4f Compare October 27, 2026 15:26
@rafvasq
rafvasq marked this pull request as ready for review October 27, 2026 16:17
@rafvasq
rafvasq requested a review from a team as a code owner October 27, 2026 16:17
…n example_readme_generator

Signed-off-by: Rafael Vasquez <[email protected]>
Assisted-by: IBM Bob
@rafvasq
rafvasq force-pushed the docs/adapters-model-capabilities-standardize branch from 584f779 to 6eb6f07 Compare October 29, 2026 13:51
@ajbozarth
ajbozarth requested a review from planetf1 October 30, 2026 22:59
@ajbozarth

Copy link
Copy Markdown
Member

cc @planetf1 as you wrote pretty much all of these

@planetf1 planetf1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for doing this, the new structure and Examples tables are a clear improvement. I'm requesting changes because a few of the docs now say things that aren't true when you run them. The details are inline. The aLora/102_example.py failure was already there on main, so I've opened #1790 for it, and #1791 covers the upload error. The changed .py files differ from base only in their docstrings, and CI is green. Thanks for the cc @ajbozarth.

Comment thread docs/examples/aLora/README.md Resolved
Comment thread docs/examples/sofai/README.md Resolved
Comment thread docs/examples/intrinsics/intrinsics.py Resolved
Comment thread docs/examples/aLora/README.md Resolved
Comment thread docs/examples/aLora/README.md Resolved
Comment thread docs/examples/aLora/README.md Resolved
Comment thread docs/examples/intrinsics/README.md Resolved
Signed-off-by: Rafael Vasquez <[email protected]>
Assisted-by: IBM Bob
@rafvasq
rafvasq requested a review from planetf1 November 5, 2026 18:51

@planetf1 planetf1 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Superseded by my later review (#1765 (review)). This earlier text went out before I had checked it, so I have removed it.

@planetf1 planetf1 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correction to my previous review: I've removed the earlier text, which went out before I'd checked it. Most of it doesn't hold up or is out of scope here.

The round-1 points are all sorted, thanks, and the new feedback_strategy table reads well. The one thing I'd still like fixed is inline: the granite-switch scripts' base_url. A smaller one: 102_example.py loads granite-3.3-2b-instruct, so the README's "use your own upload" line only works if you also ran the 3.3-2b training block. Worth a few words.

Signed-off-by: Rafael Vasquez <[email protected]>
Assisted-by: Claude Code
@rafvasq
rafvasq requested a review from planetf1 November 6, 2026 18:34
@rafvasq

rafvasq commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @planetf1! Addressed.

@planetf1 planetf1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, all sorted. I re-ran the granite-switch scripts against a live vLLM server and they work as documented.

@rafvasq
rafvasq enabled auto-merge November 6, 2026 18:48
@rafvasq
rafvasq added this pull request to the merge queue Nov 6, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 6, 2026
…-capabilities-standardize

Signed-off-by: Rafael Vasquez <[email protected]>
@rafvasq
rafvasq enabled auto-merge November 6, 2026 20:14
@rafvasq
rafvasq added this pull request to the merge queue Nov 6, 2026
Merged via the queue into generative-computing:main with commit cf484f7 Nov 6, 2026
12 checks passed
@rafvasq
rafvasq deleted the docs/adapters-model-capabilities-standardize branch November 6, 2026 21:36
planetf1 added a commit to planetf1/mellea that referenced this pull request Nov 16, 2026
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]>
ajbozarth pushed a commit to ajbozarth/mellea that referenced this pull request Nov 16, 2026
…erative-computing#1797)

* feat(adapters): accept probe slots in Granite Switch checkpoints

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]>

* fix(adapters): skip unsupported slots before resolving their io.yaml

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]>

* fix(adapters): restore probe README note and probe registration test

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]>

---------

Signed-off-by: Nigel Jones <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs(examples): Standardize structure and content across docs/examples/

3 participants