Skip to content
Notifications
Clear all

Why is Weights & Biases so slow on large evaluation datasets?

1 Posts
1 Users
0 Reactions
3 Views
(@jasonc)
Estimable Member
Joined: 1 week ago
Posts: 60
Topic starter   [#7020]

I've been conducting a series of large-scale evaluations on a fine-tuned Llama 3.1 model, using a custom dataset of approximately 250,000 prompt-response pairs. My evaluation pipeline involves calculating a suite of metrics—BERTScore, ROUGE-L, a custom entailment score using a DeBERTa model, and a proprietary metric for guideline adherence. I'm using the `wandb` Python library to log each individual score, along with the prompts and generated responses, to Weights & Biases for analysis and visualization.

The issue I'm encountering is that the logging process has become a severe bottleneck. A single run, which processes and logs these 250k rows, is taking upwards of 18 hours to complete. The local compute for the metrics themselves is relatively fast (a few hours on a GPU cluster); the overwhelming majority of the time is spent on the `wandb.log()` calls and the subsequent data upload. My initial hypothesis was network latency, but even when I batch the logs—trying groups of 10, 50, and 100 rows per `log()` call—the performance remains unacceptable. The CPU usage on the logging machine also spikes significantly during these operations.

I've reviewed the W&B documentation on optimizing for large datasets and have implemented their suggested practices with only marginal gains. My current configuration looks something like this:

```python
import wandb

run = wandb.init(
project="llm-eval-large",
config=config_dict,
settings=wandb.Settings(
_disable_stats=True,
_heartbeat_seconds=30,
_console="off"
)
)

# ... evaluation loop ...

for idx in range(0, len(dataset), BATCH_SIZE):
batch = dataset[idx:idx + BATCH_SIZE]
metrics_batch = compute_metrics(batch) # This is fast

log_dict = {
f"row_{i}_{metric_name}": value
for i, sample in enumerate(batch)
for metric_name, value in sample.items()
}
# Also tried structuring as a table with wandb.Table
wandb.log(log_dict, step=global_step)
```

My questions for the community are thus:

* **Architectural Pattern:** Is my approach to logging each individual row fundamentally flawed for a dataset of this scale in W&B? Should I be pre-aggregating results locally and logging only summary statistics (means, distributions), sacrificing granularity for performance? The value of having per-row data is for later slicing and fine-grained error analysis.
* **Tooling Limitations:** Has anyone else hit a hard performance ceiling with W&B for per-example logging at this volume (hundreds of thousands of data points)? Are there specific configuration tweaks or back-end settings I might have missed?
* **Alternative Strategies:** For those who have run into this, what did you settle on? Some options I'm considering:
* Logging to a local SQLite database or Parquet files during the run, then creating a single, aggregated W&B run at the end with summary artifacts.
* Using W&B's `wandb.Table` more aggressively, perhaps creating one table per metric, but I suspect the underlying upload size remains the constraint.
* Switching to a more event-driven architecture for the evaluation pipeline itself, where each prompt-response pair is processed and logged as a separate, asynchronous event (though this adds immense complexity).

The core tension seems to be between the desire for detailed, queryable evaluation records and the practical performance limitations of the centralized logging service. I'm particularly interested in experiences from others who have evaluated LLMs on large, custom datasets and how they structured their logging to remain both informative and efficient.


API whisperer


   
Quote