Skip to content

[Bug]: RunInference ModelManager NNLS model approximates different data points #40636

Closed

Description

@tvalentyn

What happened?

It appears that the NNLS approximation is done over data points that sometimes represent the deltas in the memory usage, and sometimes the total currently used memory. This can reduce the quality of the approximation / prediction of future memory usage.

All content below , including Suggested Fix, is LLM-generated:

ResourceEstimator receives inconsistent observations (delta vs. total memory)

  • ModelManager._spawn_new_model calls add_observation({tag: 1}, peak_during_load - baseline_snap), which records a delta.
  • ModelManager.release_model calls add_observation(snapshot_of_all_models, peak_during_job), which records total GPU memory.
  • ResourceEstimator._solve adds a +1 bias column to every row. So delta rows say cost + bias ≈ delta, while total rows say Σ count·cost + bias ≈ total. The NNLS system contradicts itself.
  • When only one model is loaded, both kinds of reading land in the same history[(("tag", 1),)] bucket.
  • The spawn delta is also noisy in the concurrent path. peak is a 30s sliding window that isn't reset before the load, so it can include earlier spikes.

Impact: per-model memory estimates are skewed, so admission control and eviction decisions can be wrong (overcommit → OOM, or needless waiting/eviction).

Suggested fix
Feed the estimator only total-memory observations with a consistent model snapshot, or drop the spawn-time observation.

Issue Priority

Priority: 2 (default / most bugs should be filed as P2)

Issue Components

  • Component: Python SDK
  • Component: Java SDK
  • Component: Go SDK
  • Component: Typescript SDK
  • Component: IO connector
  • Component: Beam YAML
  • Component: Beam examples
  • Component: Beam playground
  • Component: Beam katas
  • Component: Website
  • Component: Infrastructure
  • Component: Spark Runner
  • Component: Flink Runner
  • Component: Prism Runner
  • Component: Twister2 Runner
  • Component: Hazelcast Jet Runner
  • Component: Google Cloud Dataflow Runner

Activity

  1. tvalentyn commented on Oct 16, 2026

    @tvalentyn
    ContributorAuthor
  2. schizophrenicmaniac commented on Oct 16, 2026

    @schizophrenicmaniac
    Contributor

    .take-issue

    Hi, I'd like to work on this. _spawn_new_model passes a load delta to add_observation while release_model passes total peak memory, so I'd drop the spawn-time delta and only feed the estimator total-memory readings with the full model snapshot, plus a test in model_manager_test.py.

  3. alisha-1000 commented on Oct 22, 2026

    @alisha-1000
    Contributor

    Hi @tvalentyn,

    I reviewed the issue and the proposed fix in #40646. The inconsistency between delta-based and total-memory observations is an important edge case for the resource estimator.

    I'd be interested in helping validate the fix, particularly around concurrent model loading, memory estimation accuracy, and admission-control behavior. Are there any additional edge cases or regression tests that would benefit from investigation alongside the existing PR?

    Thank you.

  4. tvalentyn commented on Oct 22, 2026

    @tvalentyn
    ContributorAuthor

    @alisha-1000 are you using multiple identities?

  5. alisha-1000 commented on Oct 22, 2026

    @alisha-1000
    Contributor

    Hi @tvalentyn,

    I'm contributing through my GitHub account, @alisha-1000. Could you clarify what prompted the question about multiple identities? I’d be happy to clarify any confusion.

    Thank you.

  6. tvalentyn commented on Oct 22, 2026

    @tvalentyn
    ContributorAuthor

    sorry, I misread the above comment as: "I reviewed the issue and proposed the fix in...", but the fix was from someone else, hence the question.

  7. tvalentyn commented on Oct 22, 2026

    @tvalentyn
    ContributorAuthor

    I'd be interested in helping validate the fix,

    you can check the conversation in that PR if you are interested.

  8. added this to the 2.78.0 Release milestone on Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions