0lai0 opened a new pull request, #1454:
URL: https://github.com/apache/mahout/pull/1454

   ### Related Issues
   
   Closes #1429
   
   
   ### Changes
   
   - [ ] Bug fix
   - [x] New feature
   - [ ] Refactoring
   - [ ] Documentation
   - [ ] Test
   - [ ] CI/CD pipeline
   - [ ] Other
   
   ### Why
   
   <!-- Why is this change needed? -->
   Pipelines only hit memory overflow mid-run, after extended processing. This 
adds a config-only estimator so callers can check the budget and fail fast 
before the first batch.
   
   ### How
   
   <!-- What was done? -->
   Adds `qdp_core::estimate_memory()` — a pure, allocation-free function (no 
CUDA, no device queries) predicting a config's CPU prefetch-pool and GPU 
state-buffer footprint:
   - `cpu_prefetch_bytes = prefetch_depth * batch_size * sample_len * bpe`
   - `gpu_state_bytes    = 2 * batch_size * state_len * complex_bytes`
   
   Notes:
   - Returns `Result` — all arithmetic is checked; overflow / oversized 
`num_qubits`
     → `InvalidInput`, never panics.
   - f32 → f64 fallback mirrors `PipelineConfig::normalize`.
   - Streaming Parquet chunk buffer excluded (follow-up / B2).
   
   Files: `estimate.rs` (new), `lib.rs` (register + re-export), 
`tests/estimate.rs` (new).
   
   
   ## Checklist
   
   - [x] Added or updated unit tests for all changes
   - [x] Added or updated documentation for all changes
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to