fix: Pin expected tensor to same device in online retrieval test - #6777
Open
piyush182004 wants to merge 2 commits into
Open
fix: Pin expected tensor to same device in online retrieval test#6777piyush182004 wants to merge 2 commits into
piyush182004 wants to merge 2 commits into
Conversation
test_get_online_features computes `device` from torch.cuda.is_available()
and passes it when building the expected tensors for `driver_id` and
`trips`, but the `avg_orders_day` assertion omits it.
OnlineResponse.to_tensor() places its output on cuda when a GPU is
present (sdk/python/feast/online_response.py), so on a GPU host the
expected tensor stays on cpu and torch.equal raises:
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)
CI runs CPU-only, where `device` resolves to "cpu" and the omission has
no effect, so this only reproduces on machines with CUDA available.
Verified on a CUDA host: the unmodified test fails with the GPU visible
and passes under CUDA_VISIBLE_DEVICES="", while the patched test passes
in both cases.
Signed-off-by: Piyush Mondal <piyushmondal182004@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ISSUE FIXED:- #6778
What this PR does / why we need it:
test_get_online_featurescomputesdevicefromtorch.cuda.is_available()and passes it when building the expected tensors for
driver_idandtrips,but the
avg_orders_dayassertion omits it.OnlineResponse.to_tensor()places its output oncudawhen a GPU is present(
sdk/python/feast/online_response.py), so on a GPU host the expected tensorstays on
cpuandtorch.equalraises: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)
CI runs CPU-only, where
deviceresolves to"cpu"and the omission has noeffect — so this only reproduces on machines with CUDA available.
Verified on a CUDA host (RTX 4050), same machine and same code, varying only
GPU visibility:
CUDA_VISIBLE_DEVICES=""Full unit suite after the change: 2635 passed, 44 skipped.
Which issue(s) this PR fixes:
Checks
git commit -s)Testing Strategy