Lightning-AI / Lightning-AI/litData
Concurrency Budget is Static & Estimated From Hardcoded Magic Constants
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 614
- Forks
- 106
- Avg merge
- 15h 8m
- Merged PRs (30d)
- 22
Description
## Problem
In `StreamingRawDataset`, the adaptive concurrency budget for remote downloads was previously calculated using hardcoded static assumptions:
```python
_ASSUMED_AGGREGATE_BANDWIDTH_BPS = 100 * 1024 * 1024 # ~100 MB/s
_ASSUMED_REQUEST_RATE = 6000.0 # target req/s
_ASSUMED_REQUEST_LATENCY_S = 0.040 # 40 ms RTT
_DEFAULT_MEDIAN_FILE_BYTES = 256 * 1024
```
These assumptions do not reflect the large variation in real-world cloud environments.
* **Low-Bandwidth / Shared Nodes:** Multi-tenant EKS/Kubernetes nodes may provide only ~10–20 MB/s of effective bandwidth. The static model can overestimate sustainable concurrency, leading to **HTTP 429 throttling, socket saturation, and connection timeouts**.
* **High-Bandwidth / High-Performance Storage:** Dedicated A100/H100 nodes with multi-Gbps networking or low-latency object storage can support significantly higher throughput. The conservative static cap can unnecessarily limit concurrency, resulting in **GPU underutilization and reduced data-loading throughput**.
* **No Empirical Feedback Loop:** Actual download throughput and request latency were not incorporated into subsequent concurrency decisions. As a result, the concurrency budget remained largely independent of the performance characteristics of the current network and remote storage.
### in short:
The previous concurrency model was therefore **configuration-driven rather than measurement-driven**. A more robust approach should use empirical runtime measurements—such as observed download throughput and request latency—to dynamically estimate sustainable concurrency for the current execution environment.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the StreamingRawDataset concurrency-budget logic and the hardcoded bandwidth, request-rate, latency, and median-file-size constants described in the issue. Determine how observed download throughput and request latency should influence later concurrency decisions, then verify that the budget adapts across low- and high-bandwidth environments without causing throttling or underutilization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100