[PR #1417] [CLOSED] prefill: scope each split-stage loan estimate to its device #3440

Closed
opened 2026-11-07 14:41:30 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1417
Author: @imanu86
Created: 10/7/2026
Status: ❌ Closed

Base: main ← Head: pr/split-prompt-borrow


📝 Commits (1)

  • 4f9f148 OPUS-PORT-Stima il prestito del prompt sul device del proprio blocco

📊 Changes

2 files changed (+5 additions, -1 deletions)

View changed files

📝 src/prefill/prefill.cpp (+2 -1)
📝 src/program/generate.cpp (+3 -0)

📄 Description

A layer-split prompt borrows buffers from each stage's expert cache. This makes the part_slots estimate run under OnDevice(p.dev), matching the device scope used by Prefill::init and the other prompt-buffer estimates. When initialization fails inside a borrowed region, the diagnostic also reports that region's capacity.

This is a small consistency change, not a demonstrated fix for a failure in current upstream. At upstream d5ea7133741e67743c0e886bb426c0ce8d69cf6c, CUDA prompt_f16() is always false and the HIP setting is process-wide, so these devices currently produce the same count. The added scope makes the existing contract explicit before device-specific buffers are introduced.

The motivating failure occurred in our fork, which has extra Turing-only prompt buffers: RTX 3060 as the first stage and RTX 2080 Ti as the last stage, on Windows. The later stage's loan was undercounted even though free VRAM remained. Those fork-specific buffers are not part of this PR, and their successful run is not validation of this exact upstream branch.

Validation and scope:

  • Branch pr/split-prompt-borrow, head 4f9f14892da9e9d401dd7f6360e71b311912858a, one commit over 82f46a8c8f475f001ad76d92f58f4a4f8ffb0253.
  • git diff --check 82f46a8..HEAD passes. Read-only inspection against current upstream confirms neither addition is present there.
  • No fresh build or GPU run of this exact branch was performed for publication. CUDA/HIP compilation and a long-prompt layer-split regression remain pending.
  • No numerical kernel changes, new option, or speed claim. OnDevice restores the previous device when the count ends.

Suggested validation is to compare prompt loan sizes and successful prompt ingestion before/after on an ordinary layer split. Reproducing the original undercount requires device-specific allocation differences, which current upstream does not have.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1417 **Author:** [@imanu86](https://github.com/imanu86) **Created:** 10/7/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `pr/split-prompt-borrow` --- ### 📝 Commits (1) - [`4f9f148`](https://github.com/Niko1221/Strata/commit/4f9f14892da9e9d401dd7f6360e71b311912858a) OPUS-PORT-Stima il prestito del prompt sul device del proprio blocco ### 📊 Changes **2 files changed** (+5 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/prefill/prefill.cpp` (+2 -1) 📝 `src/program/generate.cpp` (+3 -0) </details> ### 📄 Description A layer-split prompt borrows buffers from each stage's expert cache. This makes the `part_slots` estimate run under `OnDevice(p.dev)`, matching the device scope used by `Prefill::init` and the other prompt-buffer estimates. When initialization fails inside a borrowed region, the diagnostic also reports that region's capacity. This is a small consistency change, not a demonstrated fix for a failure in current upstream. At upstream `d5ea7133741e67743c0e886bb426c0ce8d69cf6c`, CUDA `prompt_f16()` is always false and the HIP setting is process-wide, so these devices currently produce the same count. The added scope makes the existing contract explicit before device-specific buffers are introduced. The motivating failure occurred in our fork, which has extra Turing-only prompt buffers: RTX 3060 as the first stage and RTX 2080 Ti as the last stage, on Windows. The later stage's loan was undercounted even though free VRAM remained. Those fork-specific buffers are not part of this PR, and their successful run is not validation of this exact upstream branch. Validation and scope: - Branch `pr/split-prompt-borrow`, head `4f9f14892da9e9d401dd7f6360e71b311912858a`, one commit over `82f46a8c8f475f001ad76d92f58f4a4f8ffb0253`. - `git diff --check 82f46a8..HEAD` passes. Read-only inspection against current upstream confirms neither addition is present there. - No fresh build or GPU run of this exact branch was performed for publication. CUDA/HIP compilation and a long-prompt layer-split regression remain pending. - No numerical kernel changes, new option, or speed claim. `OnDevice` restores the previous device when the count ends. Suggested validation is to compare prompt loan sizes and successful prompt ingestion before/after on an ordinary layer split. Reproducing the original undercount requires device-specific allocation differences, which current upstream does not have. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 14:41:30 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3440
No description provided.