这是indexloc提供的服务,不要输入任何密码
Skip to content

Improve buffer.prev() & buffer.next() #294

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

Merged
merged 10 commits into from
Feb 22, 2021
Merged

Conversation

Trinkle23897
Copy link
Collaborator

@Trinkle23897 Trinkle23897 commented Feb 20, 2021

Typically in atari training pipeline, buf.prev takes over 30% time. This pr aims to optimize buffer.prev/next: use njit to make it faster.

@Trinkle23897 Trinkle23897 changed the base branch from master to dev February 20, 2021 13:06
@Trinkle23897 Trinkle23897 marked this pull request as draft February 20, 2021 13:06
@Trinkle23897 Trinkle23897 changed the title improve buffer.prev/next Improve buffer.prev/next Feb 20, 2021
@Trinkle23897 Trinkle23897 changed the title Improve buffer.prev/next Improve buffer.prev() & buffer.next() Feb 20, 2021
@codecov-io
Copy link

codecov-io commented Feb 20, 2021

Codecov Report

Merging #294 (2350373) into dev (150d0ec) will decrease coverage by 0.60%.
The diff coverage is 65.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #294      +/-   ##
==========================================
- Coverage   94.51%   93.90%   -0.61%     
==========================================
  Files          45       45              
  Lines        3152     3185      +33     
==========================================
+ Hits         2979     2991      +12     
- Misses        173      194      +21     
Flag Coverage Δ
unittests 93.90% <65.00%> (-0.61%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tianshou/data/buffer.py 93.22% <63.79%> (-5.35%) ⬇️
tianshou/policy/base.py 76.80% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 150d0ec...2350373. Read the comment docs.

@Trinkle23897 Trinkle23897 marked this pull request as ready for review February 20, 2021 15:43
@ChenDRAG
Copy link
Collaborator

ChenDRAG commented Feb 21, 2021

I prefer unfinished index over last_index.
Also, I think _lengths is redundant, there might be a better way

@ChenDRAG ChenDRAG merged commit a390ef3 into thu-ml:dev Feb 22, 2021
@Trinkle23897 Trinkle23897 deleted the fast-buffer branch February 22, 2021 11:20
BFAnas pushed a commit to BFAnas/tianshou that referenced this pull request May 5, 2024
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

Successfully merging this pull request may close these issues.

3 participants