Repository navigation
Optimize LM pipelines by combining and splitting calls - #139
Open
arthurianresolve wants to merge 148 commits into
Open
arthurianresolve wants to merge 148 commits into
arthurianresolve wants to merge 148 commits into
Conversation
…-structured-output # Conflicts: # crates/dspy-rs/src/core/lm/mod.rs # crates/dspy-rs/src/trace/span.rs
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
arthurianresolve
added a commit
to arthurianresolve/DSRs
that referenced
this pull request
Nov 19, 2026
Integrate krypticmouse#139 — Optimize LM pipelines by combining and splitting calls
This branch has not been deployed
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.
Summary of Fix
Add an optimizer that changes how a pipeline groups its LM calls, then checks whether the changed pipeline produces acceptable results faster.
For example, a pipeline may ask for a country's capital and continent in two separate calls. This PR can combine those into one call that returns both fields.
Fixes #26
Fixes #28
Why
A pipeline definition records its processing steps and which earlier results each step needs. This dependency map is called a directed acyclic graph, or DAG: arrows point from a step to the steps that use its results, and there is no circular chain of dependencies.
In this PR, a “DAG compiler” is an optimizer for that pipeline definition. It reads the dependency map, tries supported ways to combine or split calls, runs validation, and saves the selected pipeline. The resulting program runs in the existing interpreter.
The graph-editing foundations already existed, but the complete workflow for making these transformations, measuring their effects and selecting a runnable result was missing.
By default, the optimizer permits no quality decrease on any supplied validation case and requires at least a 1% reduction in mean pipeline latency. Failed evaluation or a rejected change leaves the current pipeline unchanged. These checks apply to the supplied validation workload; model behavior can differ on other inputs.
Related work
fix-hotpotqa-profiling.Testing
benchmarks/compiler/evidence/2026-11-11-mock.git diff --checkpassed.AI Disclosure