Skip to content

Commit ddf7afb

Browse files
committed
clarified comments
1 parent 7ac4c60 commit ddf7afb

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

week05_large_models/practice_part2.ipynb

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"metadata": {
55
"colab": {
66
"provenance": [],
7-
"gpuType": "T4"
7+
"gpuType": "T4",
8+
"include_colab_link": true
89
},
910
"kernelspec": {
1011
"name": "python3",
@@ -2072,6 +2073,16 @@
20722073
}
20732074
},
20742075
"cells": [
2076+
{
2077+
"cell_type": "markdown",
2078+
"metadata": {
2079+
"id": "view-in-github",
2080+
"colab_type": "text"
2081+
},
2082+
"source": [
2083+
"<a href=\"https://colab.research.google.com/github/mryab/efficient-dl-systems/blob/main/week05_large_models/practice_part2.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
2084+
]
2085+
},
20752086
{
20762087
"cell_type": "markdown",
20772088
"source": [
@@ -2101,7 +2112,7 @@
21012112
},
21022113
"outputId": "02202d9e-12d4-4341-b31f-006c356bd2b7"
21032114
},
2104-
"execution_count": 1,
2115+
"execution_count": null,
21052116
"outputs": [
21062117
{
21072118
"output_type": "stream",
@@ -2706,11 +2717,8 @@
27062717
" for name, param in tp_module.named_parameters():\n",
27072718
" print(f\"{name=},\\ttype={type(param.data)}\\tglobal shape={param.shape},\\tlocal shape={param._local_tensor.shape if hasattr(param, '_local_tensor') else param.shape}\")\n",
27082719
"\n",
2709-
" dist.barrier() # test 1: forward pass\n",
2710-
" # Convert input to DTensor with replicated placement TODO actually no\n",
2720+
" dist.barrier() # Test forward and backward pass with Tensor Parallelism\n",
27112721
" tp_input = input.detach().requires_grad_(True)\n",
2712-
"\n",
2713-
" # Test forward and backward pass with Tensor Parallelism\n",
27142722
" tp_output = tp_module(tp_input)\n",
27152723
" tp_output.sum().backward()\n",
27162724
" tp_output = tp_output.trigger_wait() # convert from AsyncCollectiveTensor to regular torch tensor\n",
@@ -2734,7 +2742,7 @@
27342742
"id": "CtvFF26mDWH2",
27352743
"outputId": "9ddddac6-65aa-4341-f12f-e884a26f0bea"
27362744
},
2737-
"execution_count": 176,
2745+
"execution_count": null,
27382746
"outputs": [
27392747
{
27402748
"output_type": "stream",
@@ -2757,7 +2765,7 @@
27572765
"id": "rbGsyCMHDtXY",
27582766
"outputId": "337e86a1-d9fa-48e2-aff0-2f0089b56ff2"
27592767
},
2760-
"execution_count": 177,
2768+
"execution_count": null,
27612769
"outputs": [
27622770
{
27632771
"output_type": "stream",
@@ -2994,7 +3002,7 @@
29943002
"id": "9ofi1_Kgusd8",
29953003
"outputId": "d456bd60-be30-4f81-917d-5ef3d9e04538"
29963004
},
2997-
"execution_count": 2,
3005+
"execution_count": null,
29983006
"outputs": [
29993007
{
30003008
"output_type": "stream",
@@ -3183,7 +3191,7 @@
31833191
"metadata": {
31843192
"id": "xBWi66FkC1dz"
31853193
},
3186-
"execution_count": 2,
3194+
"execution_count": null,
31873195
"outputs": []
31883196
},
31893197
{

0 commit comments

Comments
 (0)