Skip to main content

accelprof-knowledge

ci python license

An MCP server that answers "the profile says X — what do I do about it?" for NVIDIA GPU and AWS Neuron.

It serves a small set of curated tuning playbooks, each written as symptom → likely cause → what to check → what to try, with links to the upstream vendor documentation. An agent (or you) driving the profile → analyze → improve loop searches for a symptom and gets back the relevant playbook.

The corpus is small and hand-written, so search is a transparent keyword rank — not an embedding index that would need building and tuning.

It needs no external services — no accelerator, no cloud account, no cluster; its only runtime dependencies are the mcp SDK and PyYAML.

Install and run

pip install accelprof-knowledge
accelprof-knowledge-mcp            # streamable-http on MCP_PORT (default 8080)

Register it with any MCP client — for example Claude Code:

claude mcp add --transport http accelprof-knowledge http://127.0.0.1:8080/mcp

Two optional environment variables: MCP_PORT sets the listen port (default 8080), and KNOWLEDGE_ROOT points the server at your own playbook directory instead of the packaged one.

Tools, resources, and prompt

Tool What it does
list_topics(chip="") The available playbooks (gpu | neuron | common) — id, title, tags.
get_topic(topic_id) One playbook in full — body plus reference links, e.g. gpu/roofline.
search_knowledge(query, chip="", limit=5) The playbooks most relevant to a symptom, keyword-ranked.
// search_knowledge("memory bound but occupancy is high", chip="gpu")
{ "query": "memory bound but occupancy is high", "chip": "gpu", "count": 2,
  "results": [
    { "id": "gpu/roofline", "chip": "gpu", "score": 12.0,
      "title": "Roofline diagnosis — compute-bound vs memory-bound vs latency-bound",
      "snippet": "The roofline places a kernel by its arithmetic intensity (FLOPs per byte)…" },
    { "id": "gpu/memory-and-fusion", "chip": "gpu", "score": 7.0, "title": "…", "snippet": "…" }
  ] }

Resources knowledge://index (a browsable list) and knowledge://{chip}/{slug} (each playbook) expose the same content to clients that prefer resources, and the diagnose(chip, symptom) prompt primes an agent to search → read → propose one change.

Content

knowledge_mcp/playbooks/
  common/   methodology · metrics glossary
  gpu/      roofline · memory-and-fusion · tensor-cores-and-occupancy
  neuron/   utilization (MFU/MBU/HFU) · dma-and-collectives · compile-and-capture

Each file is Markdown with a small front matter (id, chip, title, tags, refs) and is shipped inside the wheel. Add a playbook by dropping a new .md under the right chip directory, with no code change; it is loaded at startup and becomes searchable and browsable. The playbooks are in English; search with English keywords.

Testing

pip install -e ".[test]"
python -m pytest knowledge_mcp/ -q

The suite covers front-matter parsing, list/get/search, duplicate-id detection, and that every packaged playbook loads and is well-formed.

Hosting

Dockerfile is a reference image that installs the package and runs the console script. It assumes no orchestrator; hosting this MCP alongside others is a separate concern handled by a deployment repo (distributed-ai), not a dependency of this one.

Related projects

  • accelprof — an experiment store plus an analysis MCP that maps a run to its profile files and analyzes them. Pair it with this one so a finding leads to a next step. When hosting both, give each its own MCP_PORT.
  • The official MLflow MCP — run discovery and search.

Contributing & license

Playbooks are the main contribution surface: add a Markdown file under knowledge_mcp/playbooks/<chip>/ with the front matter above, keep it distilled (symptom → cause → what to check → what to try), and link the upstream source rather than copying it. Code changes should keep python -m pytest knowledge_mcp/ -q green.

Licensed under the Apache License 2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

accelprof_knowledge-0.1.0.tar.gz (17.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

accelprof_knowledge-0.1.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file accelprof_knowledge-0.1.0.tar.gz.

File metadata

  • Download URL: accelprof_knowledge-0.1.0.tar.gz
  • Upload date:
  • Size: 17.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.8

File hashes

Hashes for accelprof_knowledge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 94f65fba35fbd00251b774f568c3e61f018f46d057acbc2d2a1947f7f0e5c240
MD5 2f0383f67da0b07967bf1e42a9946006
BLAKE2b-256 89ff46505b0412748f6565f67345f19d1d266234d250a9c44bab78737f9cde91

See more details on using hashes here.

File details

Details for the file accelprof_knowledge-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for accelprof_knowledge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee210ca0210e1208c0671686e94e6f632a15d88d29684461a888e2125a0ff657
MD5 5cbe11c9c8b9b409733436203ef61a41
BLAKE2b-256 5c027d837263f340d650adc55a486ded91bf223c24935121b38c46f892214cd6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page