test_get_online_features fails on GPU hosts: expected tensor built on cpu

Aperta Adatta ai principianti
#6,778 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
90/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, pytorch
Ambito
testing

Direzione di ricerca

Inizia da sdk/python/tests/unit/online_store/test_online_retrieval.py::test_get_online_features ed esamina le asserzioni sui tensori che tengono conto del dispositivo nelle vicinanze. Aggiorna il tensore previsto di avg_orders_day in modo che usi il dispositivo calcolato, quindi esegui il test pytest specificato con e senza visibilità di CUDA per confermare che superi il test in entrambi gli ambienti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

kind/bug priority/p2

Expected Behavior

sdk/python/tests/unit/online_store/test_online_retrieval.py::test_get_online_features should pass on any host, with or without a CUDA device.

Current Behavior

On a host with CUDA available, the test fails:

RuntimeError: Expected all tensors to be on the same device, but got other
is on cpu, different from other tensors on cuda:0
(when checking argument in method wrapper_CUDA__equal)

OnlineResponse.to_tensor() places its output on cuda when a GPU is present (sdk/python/feast/online_response.py), but the avg_orders_day assertion builds its expected tensor without a device= argument, so it stays on cpu.

The test already computes device and passes it for the driver_id and trips assertions — only avg_orders_day omits it.

Steps to reproduce

On a machine with CUDA-enabled torch installed:

python -m pytest sdk/python/tests/unit/online_store/test_online_retrieval.py::test_get_online_features

Fails with the GPU visible; passes under CUDA_VISIBLE_DEVICES="". CI is CPU-only, where device resolves to "cpu" and the omission has no effect.

Specifications
  • Version: master (0.66.0 dev)
  • Platform: Ubuntu 24.04 (WSL2), Python 3.11, torch 2.13.0+cu130, RTX 4050
  • Subsystem: online store / tests

Possible Solution

Pass device=device to the expected tensor, matching the neighbouring assertions. Submitted as #6777.

Lingua principale
Python
Stelle
7.4k
Fork
1.5k
Merge medio
2g 6h
PR unite (30g)
107

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di feast-dev/feast

Tutte le issue di feast-dev/feast

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.