Skip to content

BenchmarkJob cannot schedule against PVC-backed models; --api-model-name hardcoded to "vllm-model" #778

Closed

Description

@weetime

Summary

BenchmarkJob still assumes every BaseModel is HostPath-backed and downloaded per node. That assumption was fixed for the serving path in #656 ("Mount PVC-backed models into ISVC pods"), whose description explicitly calls itself "the serving-side half of PVC support" — the benchmark controller never got the other half.

As a result, a BenchmarkJob targeting an InferenceService whose model is pvc:// can never be scheduled. There is also a hardcoded model name that makes every benchmark request 404 against a normally-configured runtime.

Verified against main @ 86184c3.

1. PVC-backed models make the benchmark pod permanently unschedulable

pkg/controller/v1beta1/benchmark/controller.go:250 adds the model-ready node selector unconditionally:

isvcutils.AddNodeSelectorForModelReadyNode(podSpec, baseModelMeta)

and controller.go:354 builds the model volume as HostPath only:

HostPath: &v1.HostPathVolumeSource{Path: *baseModel.Storage.Path},

Both assume model-agent has staged the weights onto the node. But model-agent skips PVC storage by design — pkg/modelagent/gopher.go:

case storage.StorageTypePVC:
    s.logger.Infof("Skipping PVC storage type for model %s (handled by BaseModel controller)", modelInfo)
    return nil          // returns before the node-labeling step

and pkg/modelagent/scout.go returns false from shouldDownloadModel for PVC as well. So no node ever carries models.ome.io/<ns>.basemodel.<name>=Ready for a PVC-backed model, and the benchmark pod stays Pending forever:

0/2 nodes are available: 2 node(s) didn't match Pod's node affinity/selector.
preemption: 0/2 nodes are available: 2 Preemption is not helpful for scheduling.

This is precisely the failure mode #656 anticipated and guarded against on the serving side (components/base.go, UpdatePodSpecNodeSelector):

// Skip the per-node model-ready affinity for PVC-backed models. PVCs
// aren't tied to specific nodes and the model agent never labels nodes
// for them, so the readiness selector would leave the pod unschedulable.
if isPVCBaseModel(b) { ... return }

The benchmark controller has no equivalent branch.

podOverride cannot work around it: pod-level overrides are applied with a strategic merge patch, so the same-named volume keeps its HostPath source and nodeSelector (a map) can only gain keys, not lose them.

Related: Storage.Path is required even where it cannot exist

controller.go:346 and pkg/controller/v1beta1/benchmark/utils/utils.go:65-66 both hard-fail when Storage.Path is nil:

BaseModel <name> has missing Storage or Path information

But per #656's own description, "A pvc:// model has Storage.Path == nil" — the field is meaningful only for the HostPath case. The check belongs inside the HostPath branch.

2. --api-model-name is hardcoded to vllm-model

pkg/controller/v1beta1/benchmark/utils/utils.go:69-73:

args := map[string]string{
    "--api-key":         "sample-key", // TODO: Use actual service account key later
    "--api-model-name":  "vllm-model",
    "--model-tokenizer": *baseModel.Storage.Path,
}

--api-model-name becomes the model field of every OpenAI request genai-bench sends. vLLM and SGLang both validate it against --served-model-name and return 404 on a mismatch, so unless the runtime happens to serve under the literal name vllm-model, every request in the benchmark fails.

The failure is quiet: the job reports Completed, the pod exits 0, all result files are written — only num_error_requests inside the per-run JSON equals the request count. Nothing surfaces unless you open the results.

The correct value is already in scope in that same function (it has both the InferenceService and the BaseModel). Suggested precedence:

  1. the first value of --served-model-name in the ISVC's engine runner command/args
  2. otherwise the BaseModel name
  3. otherwise fail loudly, rather than substituting a guess

Note the neighbouring --api-key line carries a // TODO, but this one does not — it reads as an intentional constant rather than a placeholder.

3. The direct-Endpoint path is missing two required flags

utils.go:110-116:

func buildArgsFromEndpoint(endpoint *v1beta1.Endpoint) map[string]string {
	return map[string]string{
		"--api-backend":    endpoint.APIFormat,
		"--api-model-name": endpoint.ModelName,
		"--api-base":       endpoint.URL,
	}
}

No --api-key and no --model-tokenizer. genai-bench requires both (api-key is mandatory for the openai backend; --model-tokenizer is marked [required]), so a BenchmarkJob using spec.endpoint.endpoint exits immediately:

Error: Invalid value for '--api-key': API key is required for openai backend

--api-key has no envvar binding in genai-bench (only --model-api-key binds MODEL_API_KEY), so podOverride.env cannot supply it either. This path appears to be unusable for the openai backend as it stands.

Fixing this needs new fields on Endpoint (e.g. an api-key secret ref and a tokenizer reference), so it is heavier than 1 and 2. In the meantime it might be worth rejecting the combination in the webhook rather than letting the job fail inside genai-bench.

Environment

  • OME main @ 86184c3 (also reproduced on a v1.2.2-based build)
  • Kubernetes 1.30, 2 nodes
  • BaseModel: Qwen2.5-0.5B-Instruct on a shared NFS-backed PVC (pvc://<claim>/<subdir>)
  • Runtime: vLLM 0.8.5.post1

Willing to contribute

Happy to send a PR for 1 and 2 — both mirror what #656 already did on the serving side, and the pure helpers it introduced (isPVCStorage / parsePVCStorage in components/pvc.go) can be promoted to a shared package so the benchmark controller can reuse them. Please let me know if that direction looks right before I open it.

Activity

  1. weetime commented on Aug 21, 2026

    @weetime
    ContributorAuthor

    Correcting my own scoping in section 2, and adding a finding that narrows it substantially. Also withdrawing an implication about --api-key.

    Section 2 (--api-model-name) is much narrower than I made it sound

    I said "unless a runtime happens to serve under the literal name vllm-model, every request in the benchmark fails". True as far as it goes, but I never checked what the bundled runtimes actually do. Counting them:

    count --served-model-name
    config/runtimes/vllm/ 17 all vllm-model
    config/runtimes/srt/ 189 167 distinct HuggingFace ids, none vllm-model

    And SGLang doesn't validate the field at all — python/sglang/srt/openai_api/adapter.py echoes request.model back without comparing it to the served name, so there is no 404 path there.

    So none of the ~206 bundled runtime definitions are affected. The hardcoded value is aligned with the vLLM catalogue's convention; SGLang's leniency covers the rest. That explains why it has held up.

    What remains is narrower: a user-defined vLLM runtime whose --served-model-name is not vllm-model. Verified on a cluster:

    qwen2-5-0-5b-instruct → 200 OK
    vllm-model            → 404 {"message":"The model `vllm-model` does not exist."}
    

    The failure mode is what makes it worth raising at all: the BenchmarkJob reports Completed, the pod exits 0, and a full set of results and plots is written — only num_error_requests in the per-run JSON reveals that every request 404'd.

    This may well be "document the convention" rather than "change the code". Your call.

    Withdrawing an implication about --api-key

    I pointed out that the --api-key: "sample-key" line lacks the // TODO its neighbour has, implying it was an unintentional constant. That reads as a criticism it doesn't deserve.

    genai-bench only requires an API key for backends in its api_key_required list (openai, vllm, sglang); oci-cohere, oci-genai, cohere, bedrock and vertex are in no_api_key and authenticate through cloud-native mechanisms. Given BenchmarkJob.spec.endpoint.endpoint.apiFormat is openai;oci-cohere;cohere, the placeholder is doing exactly what a placeholder should for the OCI backends, and is harmless for openai since the engines OME fronts don't verify it.

    Section 3 (the direct-Endpoint path not passing --api-key/--model-tokenizer) still stands as reported, since it is scoped to the openai backend where genai-bench does require them — that path exits before sending a single request.

    Proposed direction for section 2

    Keep vllm-model as the default so the bundled runtimes are untouched, and add an optional modelName to the endpoint spec — mirroring Endpoint.ModelName, which the inferenceService branch has no equivalent of. Unset preserves today's behaviour exactly; set sends that value instead. No new resource lookups.

    Two questions before I implement:

    1. Is that shape acceptable, or would you rather this stay a documented convention?
    2. Does adding an optional field to an existing type need an OEP?

    #779 is now a draft; the patch as it stands would regress the bundled vLLM runtimes (it falls back to the BaseModel name when the InferenceService has no runner override, which is the normal case), so it should not be merged as written.

  2. weetime commented on Aug 21, 2026

    @weetime
    ContributorAuthor

    Closing. Most of what I reported here does not hold up, and I would rather retract it than leave it for someone to work through.

    Section 2 (--api-model-name hardcoded) — not a defect. spec.endpoint.endpoint.modelName is passed through as --api-model-name, so a user who needs a specific name has a supported way to give one. The "vllm-model" constant applies only to the inferenceService branch, where no name was supplied, and it matches the --served-model-name of every runtime under config/runtimes/vllm/. SGLang doesn't validate the field at all, so the srt/ catalogue is unaffected either way.

    The --api-key remark — withdrawn. genai-bench only requires a key for openai/vllm/sglang; oci-cohere, cohere and the other cloud backends authenticate through their own mechanisms. The placeholder is doing what a placeholder should, and a real key can be supplied through MODEL_API_KEY (or OPENAI_API_KEY) via podOverride.env, which takes precedence over --api-key in cli.py.

    Section 1 (PVC-backed models) — I still believe this one is real: addNodeSelectorFromInferenceService applies the model-ready affinity unconditionally while the model agent skips PVC storage by design, so the pod cannot schedule. But I have not verified it end to end on a cluster, and given how much of this report was wrong I don't want it standing on my say-so. If it turns out to matter I'll open it separately with a reproduction.

    What may still be worth a look, unreported by me for now: buildArgsFromEndpoint returns only --api-backend, --api-model-name and --api-base. For the openai backend genai-bench also requires --api-key and --model-tokenizer, so a BenchmarkJob using spec.endpoint.endpoint with that backend exits before sending a request:

    Error: Invalid value for '--api-key': API key is required for openai backend
    

    Verified by running genai-bench 0.0.5 directly. I'm not filing it as an issue because I no longer trust my reading of the intended design here — happy to if you'd find it useful.

    Apologies for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions