惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threat Research - Cisco Blogs
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
The Register - Security
The Register - Security
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
L
LangChain Blog
N
Netflix TechBlog - Medium
量子位
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
H
Help Net Security
D
Docker
D
DataBreaches.Net
T
Tailwind CSS Blog
阮一峰的网络日志
阮一峰的网络日志
B
Blog
博客园 - 聂微东
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
The Cloudflare Blog
F
Full Disclosure
GbyAI
GbyAI
F
Fortinet All Blogs
Last Week in AI
Last Week in AI
Y
Y Combinator Blog
人人都是产品经理
人人都是产品经理
Recent Announcements
Recent Announcements
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
有赞技术团队
有赞技术团队
博客园 - 叶小钗
小众软件
小众软件
V
Visual Studio Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
The GitHub Blog
The GitHub Blog
Recorded Future
Recorded Future
J
Java Code Geeks
雷峰网
雷峰网
P
Privacy & Cybersecurity Law Blog
C
Cisco Blogs
C
Cyber Attacks, Cyber Crime and Cyber Security
AWS News Blog
AWS News Blog
Webroot Blog
Webroot Blog
美团技术团队
N
News | PayPal Newsroom
G
Google Developers Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
博客园_首页
V
Vulnerabilities – Threatpost

OpenAI News

Using custom GPTs ChatGPT for customer success teams Applications of AI at OpenAI Research with ChatGPT Analyzing data with ChatGPT Financial services Responsible and safe use of AI Writing with ChatGPT ChatGPT for research Creating images with ChatGPT Personalizing ChatGPT ChatGPT for finance teams Getting started with ChatGPT Working with files in ChatGPT ChatGPT for sales teams Prompting fundamentals ChatGPT for managers Using projects in ChatGPT ChatGPT for marketing teams Brainstorming with ChatGPT AI fundamentals ChatGPT for operations teams Healthcare Our response to the Axios developer tool compromise Using skills OpenAI Full Fan Mode Contest: Terms & Conditions CyberAgent moves faster with ChatGPT Enterprise and Codex The next phase of enterprise AI Introducing the Child Safety Blueprint Introducing the OpenAI Safety Fellowship Industrial policy for the Intelligence Age OpenAI acquires TBPN Codex now offers more flexible pricing for teams Gradient Labs gives every bank customer an AI account manager OpenAI raises $122 billion to accelerate the next phase of AI Helping disaster response teams turn AI into action across Asia STADLER reshapes knowledge work at a 230-year-old company Inside our approach to the Model Spec Introducing the OpenAI Safety Bug Bounty program Helping developers build safer AI experiences for teens Update on the OpenAI Foundation Powering Product Discovery in ChatGPT Creating with Sora Safely How we monitor internal coding agents for misalignment OpenAI to acquire Astral Introducing GPT-5.4 mini and nano OpenAI Japan announces Japan Teen Safety Blueprint to put teen safety first Equipping workers with insights about compensation Why Codex Security Doesn’t Include a SAST Report Designing AI agents to resist prompt injection From model to agent: Equipping the Responses API with a computer environment Rakuten fixes issues twice as fast with Codex Wayfair boosts catalog accuracy and support speed with OpenAI Improving instruction hierarchy in frontier LLMs New ways to learn math and science in ChatGPT OpenAI to acquire Promptfoo Codex Security: now in research preview How Descript engineers multilingual video dubbing at scale How Balyasny Asset Management built an AI research engine Reasoning models struggle to control their chains of thought, and that’s good Introducing GPT-5.4 GPT-5.4 Thinking System Card Ensuring AI use in education leads to opportunity VfL Wolfsburg turns ChatGPT into a club-wide capability OpenAI and NORAD team up to bring new magic to “NORAD Tracks Santa” Accenture and OpenAI accelerate enterprise AI success OpenAI takes an ownership stake in Thrive Holdings to accelerate enterprise AI adoption What to know about a recent Mixpanel security incident Expanding data residency access to business customers worldwide Our approach to mental health-related litigation Inside JetBrains—the company reshaping how the world writes code Introducing shopping research in ChatGPT How GPT-5 helped mathematician Ernest Ryu solve a 40-year-old open problem OpenAI and Foxconn collaborate to strengthen U.S. manufacturing across the AI supply chain Disrupting malicious uses of AI: June 2025 Creating websites in minutes with AI Website Builder Addendum to OpenAI o3 and o4-mini system card: OpenAI o3 Operator OpenAI Deutschland Shipping code faster with o3, o4-mini, and GPT-4.1 Introducing Stargate UAE New tools and features in the Responses API Introducing Codex Addendum to o3 and o4-mini system card: Codex AI powers Expedia’s marketing evolution Strengthening America’s AI leadership with the U.S. National Laboratories Introducing ChatGPT Gov Operator System Card Computer-Using Agent Introducing Operator Bertelsmann powers creativity and productivity with OpenAI Trading Inference-Time Compute for Adversarial Robustness Announcing The Stargate Project Stargate Infrastructure The power of personalized AI Delivering LLM-powered health solutions Increasing accuracy of pediatric visit notes Practices for Governing Agentic AI Systems Superalignment Fast Grants Weak-to-strong generalization Partnership with Axel Springer to deepen beneficial use of AI in journalism
Techniques for training large neural networks
2022-06-09 · via OpenAI News
OpenAI

Large neural networks are at the core of many recent advances in AI, but training them is a difficult engineering and research challenge which requires orchestrating a cluster of GPUs to perform a single synchronized calculation.

Large neural networks are at the core of many recent advances in AI, but training them is a difficult engineering and research challenge which requires orchestrating a cluster of GPUs to perform a single synchronized calculation. As cluster and model sizes have grown, machine learning practitioners have developed an increasing variety of techniques to parallelize model training over many GPUs. At first glance, understanding these parallelism techniques may seem daunting, but with only a few assumptions about the structure of the computation these techniques become much more clear—at that point, you’re just shuttling around opaque bits from A to B like a network switch shuttles around packets.

Training a neural network is an iterative process. In every iteration, we do a pass forward through a model’s layers(opens in a new window) to compute an output for each training example in a batch of data. Then another pass proceeds backward(opens in a new window) through the layers, propagating how much each parameter affects the final output by computing a gradient(opens in a new window) with respect to each parameter. The average gradient for the batch, the parameters, and some per-parameter optimization state is passed to an optimization algorithm, such as Adam(opens in a new window), which computes the next iteration’s parameters (which should have slightly better performance on your data) and new per-parameter optimization state. As the training iterates over batches of data, the model evolves to produce increasingly accurate outputs.

Various parallelism techniques slice this training process across different dimensions, including:

  • Data parallelism—run different subsets of the batch on different GPUs;
  • Pipeline parallelism—run different layers of the model on different GPUs;
  • Tensor parallelism—break up the math for a single operation such as a matrix multiplication to be split across GPUs;
  • Mixture-of-Experts—process each example by only a fraction of each layer.

(In this post, we’ll assume that you are using GPUs to train your neural networks, but the same ideas apply to those using any other neural network accelerator(opens in a new window).)

Data Parallel training means copying the same parameters to multiple GPUs (often called “workers”) and assigning different examples to each to be processed simultaneously. Data parallelism alone still requires that your model fits into a single GPU’s memory, but lets you utilize the compute of many GPUs at the cost of storing many duplicate copies of your parameters. That being said, there are strategies to increase the effective RAM available to your GPU, such as temporarily offloading parameters to CPU memory between usages.

As each data parallel worker updates its copy of the parameters, they need to coordinate to ensure that each worker continues to have similar parameters. The simplest approach is to introduce blocking communication between workers: (1) independently compute the gradient on each worker; (2) average the gradients across workers(opens in a new window); and (3) independently compute the same new parameters on each worker. Step (2) is a blocking average which requires transferring quite a lot of data (proportional to the number of workers times the size of your parameters), which can hurt your training throughput. There are various asynchronous synchronization schemes(opens in a new window) to remove this overhead, but they hurt learning efficiency; in practice, people generally stick with the synchronous approach.

With Pipeline Parallel training, we partition sequential chunks of the model across GPUs. Each GPU holds only a fraction of parameters, and thus the same model consumes proportionally less memory per GPU.

It’s straightforward to split a large model into chunks of consecutive layers. However, there’s a sequential dependency between inputs and outputs of layers, so a naive implementation can lead to a large amount of idle time while a worker waits for outputs from the previous machine to be used as its inputs. These waiting time chunks are known as “bubbles,” wasting the computation that could be done by the idling machines.

We can reuse the ideas from data parallelism to reduce the cost of the bubble by having each worker only process a subset of data elements at one time, allowing us to cleverly overlap new computation with wait time. The core idea is to split one batch into multiple microbatches; each microbatch should be proportionally faster to process and each worker begins working on the next microbatch as soon as it’s available, thus expediting the pipeline execution. With enough microbatches the workers can be utilized most of the time with a minimal bubble at the beginning and end of the step. Gradients are averaged across microbatches, and updates to the parameters happen only once all microbatches have been completed.

The number of workers that the model is split over is commonly known as pipeline depth.

During the forward pass, workers only need to send the output (called activations) of its chunk of layers to the next worker; during the backward pass, it only sends the gradients on those activations to the previous worker. There’s a big design space of how to schedule these passes and how to aggregate the gradients across microbatches. GPipe(opens in a new window) has each worker process forward and backward passes consecutively and then aggregates gradients from multiple microbatches synchronously at the end. PipeDream(opens in a new window) instead schedules each worker to alternatively process forward and backward passes.

Pipeline parallelism splits a model “vertically” by layer. It’s also possible to “horizontally” split certain operations within a layer, which is usually called Tensor Parallel training. For many modern models (such as the Transformer(opens in a new window)), the computation bottleneck is multiplying an activation batch matrix with a large weight matrix. Matrix multiplication(opens in a new window) can be thought of as dot products between pairs of rows and columns; it’s possible to compute independent dot products on different GPUs, or to compute parts of each dot product on different GPUs and sum up the results. With either strategy, we can slice the weight matrix into even-sized “shards”, host each shard on a different GPU, and use that shard to compute the relevant part of the overall matrix product before later communicating to combine the results.

One example is Megatron-LM(opens in a new window), which parallelizes matrix multiplications within the Transformer’s self-attention and MLP layers. PTD-P(opens in a new window) uses tensor, data, and pipeline parallelism; its pipeline schedule assigns multiple non-consecutive layers to each device, reducing bubble overhead at the cost of more network communication.

Sometimes the input to the network can be parallelized across a dimension with a high degree of parallel computation relative to cross-communication. Sequence parallelism(opens in a new window) is one such idea, where an input sequence is split across time into multiple sub-examples, proportionally decreasing peak memory consumption by allowing the computation to proceed with more granularly-sized examples.

With the Mixture-of-Experts (MoE)(opens in a new window) approach, only a fraction of the network is used to compute the output for any one input. One example approach is to have many sets of weights and the network can choose which set to use via a gating mechanism at inference time. This enables many more parameters without increased computation cost. Each set of weights is referred to as “experts,” in the hope that the network will learn to assign specialized computation and skills to each expert. Different experts can be hosted on different GPUs, providing a clear way to scale up the number of GPUs used for a model.

Illustration of a mixture-of-experts (MoE) layer. Only 2 out of the n experts are selected by the gating network. (Image adapted from: Shazeer et al., 2017)

There are many other computational strategies to make training increasingly large neural networks more tractable. For example:

  • To compute the gradient, you need to have saved the original activations, which can consume a lot of device RAM. Checkpointing(opens in a new window) (also known as activation recomputation) stores any subset of activations, and recomputes the intermediate ones just-in-time during the backward pass. This saves a lot of memory at the computational cost of at most one additional full forward pass. One can also continually trade off between compute and memory cost by selective activation recomputation(opens in a new window), which is checkpointing subsets of the activations that are relatively more expensive to store but cheaper to compute.
  • Mixed Precision Training(opens in a new window) is to train models using lower-precision numbers (most commonly FP16(opens in a new window)). Modern accelerators can reach much higher FLOP counts with lower-precision numbers, and you also save on device RAM. With proper care, the resulting model can lose almost no accuracy.
  • Offloading is to temporarily offload unused data to the CPU or amongst different devices and later read it back when needed. Naive implementations will slow down training a lot, but sophisticated implementations will pre-fetch data so that the device never needs to wait on it. One implementation of this idea is ZeRO(opens in a new window) which splits the parameters, gradients, and optimizer states across all available hardware and materializes them as needed.
  • Memory Efficient Optimizers have been proposed to reduce the memory footprint of the running state maintained by the optimizer, such as Adafactor(opens in a new window).
  • Compression also can be used for storing intermediate results in the network. For example, Gist(opens in a new window) compresses activations that are saved for the backward pass; DALL·E compresses the gradients before synchronizing them.

At OpenAI, we are training and improving large models from the underlying infrastructure all the way to deploying them for real-world problems. If you’d like to put the ideas from this post into practice—especially relevant for our Scaling and Applied Research teams—we’re hiring!