mlx-bun library API
    Preparing search index...

    Backward that streams a sequence layer-segment by layer-segment. The driver owns the autograd (per-segment vjps over detached boundaries); the graph owns how a range of its layers runs and what crosses segment boundaries.

    interface SegmentedTraining {
        layerCount: number;
        sharedKv: {
            donorOf: readonly (number | null)[];
            reusedDonors: ReadonlySet<number>;
        };
        begin(ids: MlxArray, prefix?: PrefixLayout): SegmentedPass;
        finalNorm(h: MlxArray): MlxArray;
    }
    Index
    layerCount: number
    sharedKv: {
        donorOf: readonly (number | null)[];
        reusedDonors: ReadonlySet<number>;
    }

    K/V a layer reuses from an earlier layer of the same forward. donorOf[i] is the layer whose fetched K/V layer i consumes, or null when i attends its own; reusedDonors are the layers others consume, whose K/V must cross segment boundaries. Both are empty/null for a graph without KV sharing.