Skip to content

Commit b15c304

Browse files
committed
Rebuild
1 parent 0b3273a commit b15c304

File tree

473 files changed

+272414
-276853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

473 files changed

+272414
-276853
lines changed

β€Ždocs/.buildinfoβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: c57d324f2978132e4ba3dbcf923648de
3+
config: caa5493a4a54ecf392f96d603b7c99ae
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

β€Ždocs/_downloads/032d653a4f5a9c1ec32b9fc7c989ffe1/seq2seq_translation_tutorial.ipynbβ€Ž

Lines changed: 4 additions & 4 deletions
Large diffs are not rendered by default.

β€Ždocs/_downloads/03a48646520c277662581e858e680809/model_parallel_tutorial.ipynbβ€Ž

Lines changed: 11 additions & 11 deletions
Large diffs are not rendered by default.

β€Ždocs/_downloads/03d2b0c71eeabf3687d88081641d7a1c/flava_finetuning_tutorial.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
print(vocab[:5])
7575

7676
from datasets import load_dataset
77-
dataset = load_dataset("textvqa")
77+
dataset = load_dataset("facebook/textvqa")
7878

7979
######################################################################
8080
# λ°μ΄ν„°μ…‹μ—μ„œ μƒ˜ν”Œ μ—”νŠΈλ¦¬λ₯Ό ν‘œμ‹œν•΄ λ΄…μ‹œλ‹€:

β€Ždocs/_downloads/07d05907b3ff859aeed5f76f1acc5df4/Intro_to_TorchScript_tutorial.pyβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def forward(self, x, h):
114114
#
115115
# μ—¬λŸ¬λΆ„μ€ 좜λ ₯된 λ‚΄μš©μ—μ„œ ``grad_fn`` 을 ν™•μΈν•˜μ…¨μ„ κ²ƒμž…λ‹ˆλ‹€. 이것은
116116
# `Autograd <https://tutorials.pytorch.kr/beginner/blitz/autograd_tutorial.html>`__
117-
# 라 λΆˆλ¦¬λŠ” PyTorch의 μžλ™ λ―ΈλΆ„ λ°©λ²•μ˜ μ„ΈλΆ€ μ •λ³΄μž…λ‹ˆλ‹€. μš”μ»¨λ°, 이 μ‹œμŠ€ν…œμ€
117+
# 라 λΆˆλ¦¬λŠ” PyTorch의 μžλ™ λ―ΈλΆ„ λ°©λ²•μ˜ μ„ΈλΆ€ μ •λ³΄μž…λ‹ˆλ‹€. μš”μ»¨λŒ€, 이 μ‹œμŠ€ν…œμ€
118118
# 잠재적으둜 λ³΅μž‘ν•œ ν”„λ‘œκ·Έλž¨μ„ 톡해 미뢄을 계산할 수 있게 ν•©λ‹ˆλ‹€. 이 λ””μžμΈμ€
119119
# λͺ¨λΈ μ œμž‘μ— μ—„μ²­λ‚œ μœ μ—°μ„±μ„ μ œκ³΅ν•©λ‹ˆλ‹€.
120120
#

β€Ždocs/_downloads/0aec568a42e89122e5ca293c86289287/tensorboard_profiler_tutorial.ipynbβ€Ž

Lines changed: 9 additions & 9 deletions
Large diffs are not rendered by default.

β€Ždocs/_downloads/0ccffddcfee1f815c02241b985844376/torch_compile_user_defined_triton_kernel_tutorial.pyβ€Ž

Lines changed: 50 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
# -*- coding: utf-8 -*-
22

33
"""
4-
Using User-Defined Triton Kernels with ``torch.compile``
4+
μ‚¬μš©μž μ •μ˜ Triton 컀널을 ``torch.compile``κ³Ό ν•¨κ»˜ μ‚¬μš©ν•˜κΈ°
55
=========================================================
6-
**Author:** `Oguz Ulgen <https://github.com/oulgen>`_
6+
**μ €μž:** `Oguz Ulgen <https://github.com/oulgen>`_
7+
**λ²ˆμ—­:** `ꡬ경선 <https://github.com/kookyungseon>`_, `μ΄μ±„μš΄ <https://github.com/dlcodns>`_
78
"""
89

910
######################################################################
10-
# User-defined Triton kernels can be used to optimize specific parts of your
11-
# model's computation. These kernels are written in Triton's language, which is designed
12-
# to make it easier to achieve peak hardware performance. By using user-defined Triton
13-
# kernels with ``torch.compile``, you can integrate these optimized computations into
14-
# your PyTorch model, potentially achieving significant performance improvements.
11+
# μ‚¬μš©μž μ •μ˜ Triton 컀널을 μ‚¬μš©ν•˜λ©΄ λͺ¨λΈμ˜ νŠΉμ • λΆ€λΆ„μ˜ 계산을 μ΅œμ ν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
12+
# 이 컀널듀은 Triton의 μ–Έμ–΄λ‘œ μž‘μ„±λœ κ²ƒμœΌλ‘œ μ„€κ³„λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
13+
# μ‚¬μš©μž μ •μ˜ Triton을 μ‚¬μš©ν•˜μ—¬ ν•˜λ“œμ›¨μ–΄ μ„±λŠ₯을 졜고둜 ν–₯μƒμ‹œν‚΅λ‹ˆλ‹€.
14+
# ``torch.compile``λ₯Ό μ‚¬μš©ν•˜λŠ” 컀널은 μ΄λŸ¬ν•œ μ΅œμ ν™”λœ 계산을 톡합할 수 μžˆμŠ΅λ‹ˆλ‹€.
15+
# PyTorch λͺ¨λΈμ„ 톡해 μƒλ‹Ήν•œ μ„±λŠ₯ ν–₯상을 μ‹€ν˜„ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
1516
#
16-
# This recipes demonstrates how you can use user-defined Triton kernels with ``torch.compile``.
17+
# 이 λ ˆμ‹œν”ΌλŠ” μ‚¬μš©μž μ •μ˜ Triton 컀널을 ``torch.compile``κ³Ό ν•¨κ»˜ μ‚¬μš©ν•  수 μžˆλŠ” 방법을 λ³΄μ—¬μ€λ‹ˆλ‹€.
1718
#
18-
# Prerequisites
19+
# μ „μ œμ‘°κ±΄
1920
# -------------------
2021
#
21-
# Before starting this recipe, make sure that you have the following:
22+
# 이 λ ˆμ‹œν”Όλ₯Ό μ‹œμž‘ν•˜κΈ° 전에 λ‹€μŒμ΄ μžˆλŠ”μ§€ ν™•μΈν•©λ‹ˆλ‹€:
23+
# * ``torch.compile`` 및 Triton에 λŒ€ν•œ 기본적인 이해. μ°Έμ‘°:
2224
#
23-
# * Basic understanding of ``torch.compile`` and Triton. See:
25+
# * `torch.compiler API μ„€λͺ…μ„œ <https://pytorch.org/docs/stable/torch.compiler.html#torch-compiler>`__
26+
# * `torch.compile μ†Œκ°œ <https://tutorials.pytorch.kr/intermediate/torch_compile_tutorial.html>`__
27+
# * `Triton μ–Έμ–΄ λ¬Έμ„œ <https://triton-lang.org/main/index.html>`__
2428
#
25-
# * `torch.compiler API documentation <https://pytorch.org/docs/stable/torch.compiler.html#torch-compiler>`__
26-
# * `Introduction to torch.compile <https://tutorials.pytorch.kr/intermediate/torch_compile_tutorial.html>`__
27-
# * `Triton language documentation <https://triton-lang.org/main/index.html>`__
28-
#
29-
# * PyTorch 2.3 or later
30-
# * A GPU that supports Triton
29+
# * PyTorch 2.3 이상
30+
# * Triton을 μ§€μ›ν•˜λŠ” GPU
3131
#
3232

3333
import torch
3434
from torch.utils._triton import has_triton
3535

3636
######################################################################
37-
# Basic Usage
37+
# κΈ°λ³Έ μ‚¬μš©λ²•
3838
# --------------------
3939
#
40-
# In this example, we will use a simple vector addition kernel from the Triton documentation
41-
# with ``torch.compile``.
42-
# For reference, see `Triton documentation <https://triton-lang.org/main/getting-started/tutorials/01-vector-add.html>`__.
40+
# 이 μ˜ˆμ—μ„œλŠ” Triton λ¬Έμ„œμ˜ κ°„λ‹¨ν•œ 벑터 λ§μ…ˆ 컀널을 μ‚¬μš©ν•©λ‹ˆλ‹€.
41+
# ``torch.compile``κ³Ό ν•¨κ»˜.
42+
# μ°Έκ³ , `Triton λ¬Έμ„œλ₯Ό μ°Έκ³ ν•˜μ„Έμš” <https://triton-lang.org/main/getting-started/tutorials/01-vector-add.html>`__.
4343
#
4444

4545
if not has_triton():
@@ -79,20 +79,18 @@ def add_fn(x, y):
7979
print(f"Vector addition of\nX:\t{x}\nY:\t{y}\nis equal to\n{out}")
8080

8181
######################################################################
82-
# Advanced Usage
82+
# κ³ κΈ‰ μ‚¬μš©λ²•
8383
# -------------------------------------------------------------------
8484
#
85-
# Triton's autotune feature is a powerful tool that automatically optimizes the configuration
86-
# parameters of your Triton kernels. It explores a range of possible configurations and
87-
# selects the one that delivers the best performance for your specific use case.
88-
#
89-
# When used with ``torch.compile``, ``triton.autotune`` can help ensure that your PyTorch
90-
# model is running as efficiently as possible. Here is an example of using ``torch.compile``
91-
# and ``triton.autotune``.
85+
# Triton의 μžλ™ νŠœλ‹ κΈ°λŠ₯은 Triton μ»€λ„μ˜ ꡬ성 λ§€κ°œλ³€μˆ˜λ₯Ό μžλ™μœΌλ‘œ μ΅œμ ν™”ν•΄μ£ΌλŠ” κ°•λ ₯ν•œ λ„κ΅¬μž…λ‹ˆλ‹€.
86+
# λ‹€μ–‘ν•œ 섀정을 κ²€ν† ν•˜μ—¬ νŠΉμ • μ‚¬μš© 사둀에 졜적의 μ„±λŠ₯을 μ œκ³΅ν•˜λŠ” ꡬ성을 μ„ νƒν•©λ‹ˆλ‹€.
9287
#
88+
# ``torch.compile``κ³Ό ν•¨κ»˜ μ‚¬μš©ν•  경우 ``triton.autotune``을 μ‚¬μš©ν•˜λ©΄ PyTorch λͺ¨λΈμ„ μ΅œλŒ€ν•œ 효율적으둜
89+
# μ‹€ν–‰ν•  수 μžˆμŠ΅λ‹ˆλ‹€. μ•„λž˜λŠ” ``torch.compile``κ³Ό ``triton.autotune``을 μ‚¬μš©ν•˜λŠ” μ˜ˆμ œμž…λ‹ˆλ‹€.
90+
#
9391
# .. note::
94-
#
95-
# ``torch.compile`` only supports configs and key arguments to ``triton.autotune``.
92+
# ``torch.compile``은 ``triton.autotune``에 λŒ€ν•œ configs와 key 인수만 μ§€μ›ν•©λ‹ˆλ‹€.
93+
#
9694

9795
if not has_triton():
9896
print("Skipping because triton is not supported on this device.")
@@ -140,32 +138,30 @@ def add_fn(x, y):
140138
print(f"Vector addition of\nX:\t{x}\nY:\t{y}\nis equal to\n{out}")
141139

142140
######################################################################
143-
# Composibility and Limitations
141+
# ν˜Έν™˜μ„±κ³Ό μ œν•œμ‚¬ν•­
144142
# --------------------------------------------------------------------
145143
#
146-
# As of PyTorch 2.3, the support for user-defined Triton kernels in ``torch.compile``
147-
# includes dynamic shapes, ``torch.autograd.Function``, JIT inductor, and AOT inductor.
148-
# You can use these features together to build complex, high-performance models.
149-
#
150-
# However, there are certain limitations to be aware of:
151-
#
152-
# * **Tensor Subclasses:** Currently, there is no support for
153-
# tensor subclasses and other advanced features.
154-
# * **Triton Features:** While ``triton.heuristics`` can be used either standalone or
155-
# before ``triton.autotune``, it cannot be used after ```triton.autotune``. This
156-
# implies that if ``triton.heuristics`` and ``triton.autotune`` are to be used
157-
# together, ``triton.heuristics`` must be used first.
158-
#
159-
# Conclusion
144+
# PyTorch 2.3 버전 κΈ°μ€€μœΌλ‘œ, ``torch.compile``의 μ‚¬μš©μž μ •μ˜ Triton μ»€λ„μ—λŠ” 동적 λͺ¨μ–‘
145+
# ``torch.autograd.Function``, JIT inductor, AOT inductorκ°€ μ§€μ›λ©λ‹ˆλ‹€. 이 κΈ°λŠ₯듀을
146+
# μ‘°ν•©ν•˜μ—¬ λ³΅μž‘ν•˜κ³  κ³ μ„±λŠ₯인 λͺ¨λΈμ„ ꡬ좕할 수 μžˆμŠ΅λ‹ˆλ‹€.
147+
#
148+
# κ·ΈλŸ¬λ‚˜ μ•Œμ•„λ‘μ–΄μ•Ό ν•  λͺ‡ κ°€μ§€ μ œν•œ 사항이 μžˆμŠ΅λ‹ˆλ‹€.
149+
#
150+
# * **Tensor Subclasses:** ν˜„μž¬λ‘œμ„œλŠ” Tensor ν•˜μœ„ 클래슀 및 기타 κ³ κΈ‰ κΈ°λŠ₯은 μ§€μ›λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
151+
#
152+
# * **Triton Features:** ``triton.heuristics``λŠ” λ‹¨λ…μœΌλ‘œ μ‚¬μš©ν•˜κ±°λ‚˜ ``triton.autotune`` μ•žμ—μ„œ
153+
# μ‚¬μš©ν•  수 μžˆμ§€λ§Œ, ``triton.autotune`` λ’€μ—μ„œλŠ” μ‚¬μš©ν•  수 μ—†μŠ΅λ‹ˆλ‹€. λ”°λΌμ„œ ``triton.heuristics``와
154+
# ``triton.autotune``을 ν•¨κ»˜ μ‚¬μš©ν•˜λ €λ©΄ ``triton.heuristics``λ₯Ό λ¨Όμ € μ‚¬μš©ν•΄μ•Ό ν•©λ‹ˆλ‹€.
155+
#
156+
# κ²°λ‘ 
160157
# -----------
161-
# In this recipe, we explored how to utilize user-defined Triton kernels
162-
# with ``torch.compile``. We delved into the basic usage of a simple
163-
# vector addition kernel and advanced usage involving Triton's autotune
164-
# feature. We also discussed the composability of user-defined Triton
165-
# kernels with other PyTorch features and highlighted some current limitations.
158+
#
159+
# 이 λ ˆμ‹œν”Όμ—μ„œλŠ” μ‚¬μš©μž μ •μ˜ Triton 컀널을 ``torch.compile``둜 ν™œμš©ν•˜λŠ” 방법을 μ•Œμ•„λ³΄μ•˜μŠ΅λ‹ˆλ‹€. κ°„λ‹¨ν•œ
160+
# 벑터 λ§μ…ˆ μ»€λ„μ˜ κΈ°λ³Έ μ‚¬μš©λ²•κ³Ό Triton의 μžλ™ νŠœλ‹ κΈ°λŠ₯을 ν¬ν•¨ν•œ κ³ κΈ‰ μ‚¬μš©λ²•μ— λŒ€ν•΄ λ‹€λ€˜μŠ΅λ‹ˆλ‹€. λ˜ν•œ μ‚¬μš©μž
161+
# μ •μ˜ Triton 컀널과 λ‹€λ₯Έ Pytorch κΈ°λŠ₯의 μ‘°ν•© κ°€λŠ₯성에 λŒ€ν•΄ λ…Όμ˜ν•˜κ³  ν˜„μž¬μ˜ λͺ‡ κ°€μ§€ μ œν•œ 사항을 κ°•μ‘°ν–ˆμŠ΅λ‹ˆλ‹€.
166162
#
167-
# See Also
163+
# κ΄€λ ¨ ν•­λͺ©
168164
# ---------
169165
#
170-
# * `Compiling the Optimizers <https://tutorials.pytorch.kr/recipes/compiling_optimizer.html>`__
171-
# * `Implementing High-Performance Transformers with Scaled Dot Product Attention <https://tutorials.pytorch.kr/intermediate/scaled_dot_product_attention_tutorial.html>`__
166+
# * `Optimizer μ»΄νŒŒμΌν•˜κΈ° <https://tutorials.pytorch.kr/recipes/compiling_optimizer.html>`__
167+
# * `Scaled Dot Product Attention을 ν™œμš©ν•œ κ³ μ„±λŠ₯ Transformer κ΅¬ν˜„ν•˜κΈ° <https://tutorials.pytorch.kr/intermediate/scaled_dot_product_attention_tutorial.html>`__

0 commit comments

Comments
Β (0)