AI library node implementations: follow-ups from #2557

Open
#2,724 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

The issue groups several follow-ups from the review of #2557, including subgraph expansion, agent tools, environment collision checks, numerical validation, hardware discovery, structured diagnostics, type inference, and build token measurement. Start by reading #2557 and its review discussion, then locate the corresponding AI node implementation and tests. Choose one follow-up and define its behavior and acceptance checks before making changes; done means the selected behavior is implemented and covered by tests.

Written by the indexing model from the issue text.

Description

Follow-ups to the 'ai' library node implementations of #2557, collected from the review discussion. Each was agreed to be out of scope for that PR.

AI implementations beyond tasklets
  • Expand a nested SDFG, a control-flow region or a dataflow subgraph (e.g., a map or loop nest) with 'ai', not only a single library node. The prompt would carry the subgraph and a baseline C++ rendering of it, and the result would replace the whole subgraph.
  • Use a node's pure expansion as the specification of its semantics where that fits in the prompt, e.g., as a schedule tree.
Agent tools
  • Expose the existing Python API to the agent as tools: the compile check of a generated tasklet, and environment discovery (registered DaCe environments, pkg-config, spack). Say in the prompt that they exist and when to use them.
  • Define whether and how an agent may install a missing dependency and register it as an environment. Prompt rules: reuse an environment that satisfies the requirement, never register a second one for a covered dependency, and check that a registered library is actually installed.
  • Guard environments against collisions: names that normalize to the same environment (my-env, my env, my_env), and two environments that link the same library (e.g., OpenBLAS).
Correctness of generated implementations
  • Check a generated implementation numerically, not only that it compiles: fuzzed tests at symbolic shapes, against the pure expansion where one exists. This guards against reward hacking and vague specifications, which waste tokens.
Context and diagnostics
  • Read hardware details through vendor packages where they are installed (py-cpuinfo, nvidia-ml-py, amdsmi), falling back to the current parsing, without adding them as dependencies.
  • Read compiler diagnostics in a structured format (SARIF) once Clang and GCC output is stable and compact enough.
  • Infer connector types read-only, without the deep copy of the SDFG in context.py (shares code with the default schedule and storage inference in infer_types.py).
  • Measure the token cost of a first build without debugprint against one with it, to decide which builds should enable it.
Dominant language
Python
Stars
602
Forks
171
Avg merge
1d 16h
Merged PRs (30d)
43

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from spcl/dace

All issues in spcl/dace

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.