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

Dynamic batch size #5

Open
dxoigmn opened this issue Jan 27, 2025 · 0 comments
Open

Dynamic batch size #5

dxoigmn opened this issue Jan 27, 2025 · 0 comments

Comments

@dxoigmn
Copy link
Contributor

dxoigmn commented Jan 27, 2025

The batch size is a critical component of llmart's efficiency. Having a device (CPU/GPU) with more memory (RAM/VRAM) means being able to process more swaps (samples) in parallel.

Right now the user must pass per_device_bs=N if they want LLMart to process a batch of N samples in parallel.

HF provides find_executable_batch_size, that enables us to programmatically find a suitable batch size. Your job is to figure out where to put this call in LLMart such that it doesn't significantly slow down the basic attack. That is, python -m llmart model=llama3-8b-instruct data=basic per_device_bs=64 should run just about as fast as ts -nfG1 python -m llmart model=llama3-8b-instruct data=basic per_device_bs=auto.

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

No branches or pull requests

2 participants