[Fix] road_traffic map_type="2" crashes on GPU reset#175
Open
vtalpaert wants to merge 2 commits intoproroklab:mainfrom
Open
[Fix] road_traffic map_type="2" crashes on GPU reset#175vtalpaert wants to merge 2 commits intoproroklab:mainfrom
vtalpaert wants to merge 2 commits intoproroklab:mainfrom
Conversation
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.
Fixes three bugs in
vmas/scenarios/road_traffic.pythat caused crashes when usingmap_type="2"on a GPU device, once the initial state buffer has accumulated at least one entry.Missing return in
reset_init_stateWhen
is_use_state_buffer=True, the function set agent position/rotation/velocity from the buffer but is missing a return statement (TypeError: cannot unpack non-iterable NoneType object)Fixed by adding
return ref_path, path_idin theis_use_state_bufferbranch.Device mismatch in reset/record conditions
torch.rand(1)created a CPU tensor whileprobability_use_recordingandprobability_recordlived on the env device (possibly GPU), raising:RuntimeError: Expected all tensors to be on the same deviceFixed by passing
device=self.world.deviceto bothtorch.rand(1)in two calls.Tests added in
tests/test_scenarios/test_road_traffic.py:test_map_type_runs— sanity check for both map types on CPUtest_map_type_2_reset_uses_buffer— CPU, reproduces first bugtest_gpu_map_type_2_rand_device— GPU-only, reproduces device bug