8000 Remove `all_pks` from Sampler.sample by ProKil · Pull Request #160 · sotopia-lab/sotopia · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove all_pks from Sampler.sample #160

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 5 commits into from
Aug 13, 2024
Merged

Conversation

ProKil
Copy link
Member
@ProKil ProKil commented Jul 28, 2024

Closes #159

📑 Description

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed
  • Branch name follows type/descript (e.g. feature/add-llm-agents)
  • Ready for code review

ℹ Additional Information

Copy link
codecov bot commented Jul 28, 2024

Codecov Report

Attention: Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.

Project coverage is 61.22%. Comparing base (0edf4b0) to head (e752656).

Files Patch % Lines
sotopia/samplers/uniform_sampler.py 62.50% 3 Missing ⚠️
sotopia/samplers/constraint_based_sampler.py 85.71% 1 Missing ⚠️
@@            Coverage Diff             @@
##             main     #160      +/-   ##
==========================================
+ Coverage   60.99%   61.22%   +0.22%     
==========================================
  Files          55       55              
  Lines        2797     2798       +1     
==========================================
+ Hits         1706     1713       +7     
+ Misses       1091     1085       -6     
Files Coverage Δ
sotopia/database/__init__.py 100.00% <100.00%> (ø)
sotopia/samplers/constraint_based_sampler.py 90.90% <85.71%> (+1.67%) ⬆️
sotopia/samplers/uniform_sampler.py 84.84% <62.50%> (+10.48%) ⬆️

@ProKil ProKil requested a review from XuhuiZhou July 28, 2024 15:49
@ProKil
Copy link
Member Author
ProKil commented Jul 31, 2024

@XuhuiZhou Would you mind helping me check if this is faster? I have other optimization in mind, but I want to confirm that this works. It should be much faster when calling sample function

Copy link
Member
@XuhuiZhou XuhuiZhou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ProKil I tried and timed the
python examples/minimalist_demo.py on this new version of code, and it costs me 4mins to finish a single episode.

Any chance you may test on your side and we can compare?

Specifically,

time python examples/minimalist_demo.py

And the output is:

python examples/minimalist_demo.py  1.86s user 2.64s system 1% cpu 4:06.94 total

@XuhuiZhou
Copy link
Member

New timing after running, much faster!
python examples/minimalist_demo.py 1.73s user 2.33s system 6% cpu 59.443 total

8000

@ProKil
Copy link
Member Author
ProKil commented Aug 13, 2024

@XuhuiZhou Should we merge it then?

@XuhuiZhou XuhuiZhou self-requested a review August 13, 2024 19:50
@XuhuiZhou XuhuiZhou merged commit 9d50654 into main Aug 13, 2024
8 checks passed
@ProKil ProKil deleted the feature/reduce-all-pks-usage branch August 14, 2024 15:11
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.

[FEAT]: Remove all_pks from UniformSampler
2 participants
0