Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed Bottleneck due to dataset #815

Open
jacklu333333 opened this issue Jan 7, 2023 · 0 comments
Open

Speed Bottleneck due to dataset #815

jacklu333333 opened this issue Jan 7, 2023 · 0 comments

Comments

@jacklu333333
Copy link

Hi,
I am using TFUniformReplayBuffer with DynamicEpisodeDriverwith the former config device as GPU. However, in mytf.profile` it shows that the following code is actually running on the CPU.

dataset = replay_buffer.as_dataset(
    num_parallel_calls=16, 
    sample_batch_size=batch_size,
    num_steps=n_step_update + 1,
    ).prefetch(10)
iterator = iter(dataset)
experience, buffer_info = next(iterator)
train_loss = agent.train(experience)

Is there any way that I can make the iteration of the dataset run in the GPU instead of sending them back and forth?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant