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 up vault tests #42

Open
mickvangelderen opened this issue Nov 8, 2024 · 2 comments
Open

Speed up vault tests #42

mickvangelderen opened this issue Nov 8, 2024 · 2 comments

Comments

@mickvangelderen
Copy link
Contributor

The tests in vault_test.py take a considerable amount of time to run. Perhaps the parameters can be tuned to make the tests run faster without losing confidence that the code works.

@mickvangelderen mickvangelderen changed the title Vault tests are slow Speed up vault tests Nov 8, 2024
@sash-a
Copy link
Contributor

sash-a commented Nov 12, 2024

Totally agreed @mickvangelderen. Would you be able to make a PR for this? 😄

I think here:

@pytest.fixture()
def max_length() -> int:
    return 256


@pytest.fixture()
def fake_transition() -> FbxTransition:
    return FbxTransition(
        obs=CustomObservation(
            x=jnp.ones(shape=(1, 2, 3), dtype=jnp.float32),
            y=jnp.ones(shape=(4, 5, 6), dtype=jnp.float32),
        ),
        act=jnp.ones(shape=(7, 8), dtype=jnp.float32),
    )

We can drop the max length to 8 and make the shapes much smaller maybe all of them can be (1,1,2)? I don't think it will save a huge amount of time, but maybe a minute?

@mickvangelderen
Copy link
Contributor Author

mickvangelderen commented Nov 12, 2024

Thanks for the suggestion—it’s similar to what I implemented locally, and it does work well! I’m happy to open a PR for it, but I currently have three other PRs that I'd like to prioritize discussing first, if possible:

Thank you!

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

2 participants