1. Hitting the Scaling Wall
Over time, Discord’s machine-learning stack evolved from lightweight classifiers to large-scale systems supporting hundreds of millions of users. As datasets ballooned and models grew deeper, the team began running into scaling limits — single machines couldn’t hold the data, training jobs needed multiple GPUs, and compute requirements quickly outgrew what existing infrastructure could provide.
Distributed compute became essential, but making it usable was the real challenge. The open-source framework Ray offered the technical foundation, yet Discord wanted to build something far more ergonomic — a platform engineers could enjoy using. Around Ray, the company created custom tooling: a CLI, a Dagster + KubeRay orchestration layer, and a monitoring UI called X-Ray. Together, these turned distributed ML from a painful setup into a streamlined, developer-friendly environment.
2. The Early Days of Ray at Discord
Adoption started organically. Individual ML engineers began experimenting with Ray to unblock their own scaling bottlenecks. They spun up clusters manually, tweaking open-source examples and YAMLs until something worked. While this DIY approach proved Ray’s potential, it also surfaced new problems: no configuration standard, inconsistent resource management, and zero unified way to schedule or monitor jobs.
It quickly became clear that Ray solved distribution — but Discord still needed an internal Ray platform to handle reliability, consistency, and developer experience.
3. From YAML Headaches to One CLI Command
The first big usability upgrade came in the form of a custom command-line interface.
Instead of juggling dozens of YAML templates for every GPU combination, engineers could run a single, parameterized command specifying GPU type, number of workers, and memory. The CLI generated the full configuration at runtime, applied Kubernetes security rules, and deployed clusters automatically.
This shift unified configurations across teams, aligned hardware requests with actual resources, and let engineers launch a multi-GPU Ray cluster in seconds — no more debugging YAML syntax. The same tool handled cluster creation, job submission, and teardown, setting the tone for a developer-centric platform.
4. Orchestration: From Ad-hoc Jobs to Automated Pipelines
To move beyond one-off training runs, Discord embedded Ray into its broader orchestration system built on Dagster, KubeRay, and Ray itself.
- Dagster defines pipelines, configurations, and dependencies. Engineers can trigger jobs on a schedule or from the Dagster Launchpad, passing structured parameters (like 
model_name,data_window, orgpu_pool) that are schema-validated to prevent runtime errors. - KubeRay dynamically provisions Ray clusters within Kubernetes, attaching the right node pools and service accounts.
 - Ray then executes distributed workloads — training, evaluation, or batch inference — across GPUs.
 
Workflow summary:
- The engineer triggers or schedules a pipeline in Dagster.
 - Dagster submits a Ray job spec to the Job Operator.
 - KubeRay spins up a Ray cluster in the correct namespace.
 - Ray distributes the workload across GPUs.
 - Logs and metrics stream back to Dagster dashboards.
 
The design brought predictability (versioned configs instead of handwritten YAML), reproducibility (infra tied to code), and visibility (logs viewable directly in Dagster without SSH). For example, the high-load Ad Relevance model now trains daily — fully automated and hands-off.
5. Observability: Introducing X-Ray
As more teams adopted the platform, Discord saw the need for deeper visibility into Ray operations.
They built X-Ray, a centralized web dashboard that lets ML engineers observe every running cluster in real time — including ownership, machine type, and status. It also supports launching interactive notebooks for experimentation.
X-Ray unified monitoring and simplified troubleshooting, giving engineers a single source of truth for their distributed workloads.
6. Real-World Proof: The Ads Ranking Model
The best validation came from Ads Ranking, Discord’s model for matching users with the Quests they’re most likely to join. It marked the company’s first production-scale deep-learning deployment.
Previously, the team used XGBoost; scaling to neural networks was theoretically possible but operationally painful — no sharding, no multi-GPU, and no consistent retraining.
With Ray, Ads Ranking transitioned to sharded neural networks trained on multi-GPU clusters. Results were dramatic:
- Player participation in Quests doubled.
 - Coverage expanded from roughly 40% to nearly 100% of ads traffic.
 - The model now retrains daily and continuously ships improved versions.
 
One ML engineer even built a complete testing framework in a single day using only Ray and Dagster docs — no custom tooling or manual babysitting required. It proved that with the right infrastructure, large-scale deep learning can be fast, reliable, and pleasant to work with.
7. Ray as the Foundation of Discord ML
What began as fragmented experimentation has become Discord’s ML backbone.
Today, Ray underpins how multiple teams — from Ads to Safety to Shop — train, deploy, and monitor their models. Engineers can move faster, iterate confidently, and rely on consistent infrastructure.
Models once blocked by resource limits now run daily; production pipelines deliver measurable business impact.
Discord continues investing in the platform by optimizing performance, refining the developer experience, and expanding capabilities.
The result: distributed ML that’s no longer intimidating, but empowering — or, as the team puts it, there’s plenty more on the ho-Ray-zon.