wandb / wandb

The AI developer platform. Use Weights & Biases to train and fine-tune models, and manage models from experimentation to production.
https://wandb.ai
MIT License
8.91k stars 656 forks source link

per_page Parameter Not Limiting Runs in api.runs #6884

Open MahdiJafari1 opened 7 months ago

MahdiJafari1 commented 7 months ago

Describe the bug

I am experiencing an issue with the per_page parameter in the api.runs method of the WandB API. When I set a specific limit using per_page, the method still returns all available runs, ignoring the specified limit.

My code:

api = wandb.Api(api_key=os.getenv("API_KEY"), timeout=None)
runs = api.runs(f"{entity}/{project}", per_page=per_page)

Steps to Reproduce

Initialize the WandB API using wandb.Api(). Fetch runs using api.runs(f"{entity}/{project}", per_page=specific_number). Observe that the number of runs returned is not limited to the specific_number defined in per_page.

Expected Behavior

The api.runs method should return only the number of runs specified in the per_page parameter. Actual Behavior

All available runs are returned, disregarding the per_page parameter. Additional Information

Additional Files

No response

Environment

WandB version: 0.13.7

OS: Ubuntu 22.04

Python version: 3.10

Versions of relevant libraries:

Additional Context

No response

umakrishnaswamy commented 7 months ago

hey @MahdiJafari1 - I was able to reproduce this behavior and will let you know if progress arises on a fix! thank you for flagging

aviyashchin commented 5 months ago

I would also like to see if this could be a feature. We use WANDB for our system of record and would like to scale beyond 5-10k experiments without the need for multiple projects.

I see this error also reported in other (non-WANDB Support) places including: https://stackoverflow.com/questions/77846820/how-to-get-paginated-runs-using-wandb-client https://github.com/wandb/wandb/issues/3815