Skip to content

Commit c1f49f4

Browse files
iamzainhudafacebook-github-bot
authored andcommitted
update colab notebook package installation
Summary: to address: #1736 installation changed to: ``` !pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121 -U !pip3 install fbgemm_gpu --index-url https://download.pytorch.org/whl/nightly/cu121 !pip3 install torchmetrics==1.0.3 !pip3 install torchrec --index-url https://download.pytorch.org/whl/nightly/cu121 ``` Reviewed By: henrylhtsang Differential Revision: D54547391 fbshipit-source-id: ec2254eb7d4d2c2be4d696c59d9eeb37e25836d8
1 parent e96e10d commit c1f49f4

File tree

1 file changed

+47
-108
lines changed

1 file changed

+47
-108
lines changed

Torchrec_Introduction.ipynb

Lines changed: 47 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -19,98 +19,26 @@
1919
"source": [
2020
"## **Installation**\n",
2121
"Requirements:\n",
22-
"- python >= 3.7\n",
22+
"- python >= 3.9\n",
2323
"\n",
2424
"We highly recommend CUDA when using TorchRec. If using CUDA:\n",
25-
"- cuda >= 11.0\n"
26-
]
27-
},
28-
{
29-
"cell_type": "code",
30-
"execution_count": null,
31-
"metadata": {
32-
"id": "BB2K68OYUJ_t"
33-
},
34-
"outputs": [],
35-
"source": [
36-
"# install conda to make installying pytorch with cudatoolkit 11.3 easier. \n",
37-
"!wget https://repo.anaconda.com/miniconda/Miniconda3-py37_4.9.2-Linux-x86_64.sh\n",
38-
"!chmod +x Miniconda3-py37_4.9.2-Linux-x86_64.sh\n",
39-
"!bash ./Miniconda3-py37_4.9.2-Linux-x86_64.sh -b -f -p /usr/local"
40-
]
41-
},
42-
{
43-
"cell_type": "code",
44-
"execution_count": null,
45-
"metadata": {
46-
"id": "sFYvP95xaAER"
47-
},
48-
"outputs": [],
49-
"source": [
50-
"# install pytorch with cudatoolkit 11.6\n",
51-
"!conda install pytorch pytorch-cuda=11.6 -c pytorch-nightly -c nvidia -y"
52-
]
53-
},
54-
{
55-
"cell_type": "markdown",
56-
"metadata": {
57-
"id": "7iY7Uv11mJYK"
58-
},
59-
"source": [
25+
"- cuda >= 11.8\n",
26+
"\n",
6027
"Installing TorchRec will also install [FBGEMM](https://github.com/pytorch/fbgemm), a collection of CUDA kernels and GPU enabled operations to run "
6128
]
6229
},
6330
{
6431
"cell_type": "code",
6532
"execution_count": null,
6633
"metadata": {
67-
"id": "tUnIw-ZREQJy"
68-
},
69-
"outputs": [],
70-
"source": [
71-
"# install torchrec\n",
72-
"!pip3 install torchrec-nightly"
73-
]
74-
},
75-
{
76-
"cell_type": "markdown",
77-
"metadata": {
78-
"id": "b6EHgotRXFQh"
79-
},
80-
"source": [
81-
"The following steps are needed for the Colab runtime to detect the added shared libraries. The runtime searches for shared libraries in /usr/lib, so we copy over the libraries which were installed in /usr/local/lib/. **This is a very necessary step, only in the colab runtime**. "
82-
]
83-
},
84-
{
85-
"cell_type": "code",
86-
"execution_count": null,
87-
"metadata": {
88-
"id": "_P45pDteRcWj"
89-
},
90-
"outputs": [],
91-
"source": [
92-
"!cp /usr/local/lib/lib* /usr/lib/"
93-
]
94-
},
95-
{
96-
"cell_type": "markdown",
97-
"metadata": {
98-
"id": "n5_X2WOAYG3c"
99-
},
100-
"source": [
101-
"\\**Restart your runtime at this point for the newly installed packages to be seen.** Run the step below immediately after restarting so that python knows where to look for packages. **Always run this step after restarting the runtime.**"
102-
]
103-
},
104-
{
105-
"cell_type": "code",
106-
"execution_count": null,
107-
"metadata": {
108-
"id": "8cktNrh8R9rC"
34+
"id": "sFYvP95xaAER"
10935
},
11036
"outputs": [],
11137
"source": [
112-
"import sys\n",
113-
"sys.path = ['', '/env/python', '/usr/local/lib/python37.zip', '/usr/local/lib/python3.7', '/usr/local/lib/python3.7/lib-dynload', '/usr/local/lib/python3.7/site-packages']"
38+
"!pip3 install --pre torch --index-url https://download.pytorch.org/whl/nightly/cu121 -U\n",
39+
"!pip3 install fbgemm_gpu --index-url https://download.pytorch.org/whl/nightly/cu121\n",
40+
"!pip3 install torchmetrics==1.0.3\n",
41+
"!pip3 install torchrec --index-url https://download.pytorch.org/whl/nightly/cu121"
11442
]
11543
},
11644
{
@@ -625,35 +553,46 @@
625553
}
626554
],
627555
"metadata": {
628-
"accelerator": "GPU",
629-
"colab": {
630-
"background_execution": "on",
631-
"collapsed_sections": [],
632-
"machine_shape": "hm",
633-
"name": "Torchrec Introduction.ipynb",
634-
"provenance": []
635-
},
636-
"interpreter": {
637-
"hash": "d4204deb07d30e7517ec64733b2d65f24aff851b061e21418071854b06459363"
638-
},
639-
"kernelspec": {
640-
"display_name": "Python 3.7.13 ('torchrec': conda)",
641-
"language": "python",
642-
"name": "python3"
643-
},
644-
"language_info": {
645-
"codemirror_mode": {
646-
"name": "ipython",
647-
"version": 3
556+
"custom": {
557+
"cells": [],
558+
"metadata": {
559+
"accelerator": "GPU",
560+
"colab": {
561+
"background_execution": "on",
562+
"collapsed_sections": [],
563+
"machine_shape": "hm",
564+
"name": "Torchrec Introduction.ipynb",
565+
"provenance": []
566+
},
567+
"fileHeader": "",
568+
"fileUid": "c9a29462-2509-4adb-a539-0318cf56bb00",
569+
"interpreter": {
570+
"hash": "d4204deb07d30e7517ec64733b2d65f24aff851b061e21418071854b06459363"
571+
},
572+
"isAdHoc": false,
573+
"kernelspec": {
574+
"display_name": "Python 3.7.13 ('torchrec': conda)",
575+
"language": "python",
576+
"name": "python3"
577+
},
578+
"language_info": {
579+
"codemirror_mode": {
580+
"name": "ipython",
581+
"version": 3
582+
},
583+
"file_extension": ".py",
584+
"mimetype": "text/x-python",
585+
"name": "python",
586+
"nbconvert_exporter": "python",
587+
"pygments_lexer": "ipython3",
588+
"version": "3.7.13"
589+
}
648590
},
649-
"file_extension": ".py",
650-
"mimetype": "text/x-python",
651-
"name": "python",
652-
"nbconvert_exporter": "python",
653-
"pygments_lexer": "ipython3",
654-
"version": "3.7.13"
655-
}
591+
"nbformat": 4,
592+
"nbformat_minor": 0
593+
},
594+
"indentAmount": 2
656595
},
657596
"nbformat": 4,
658-
"nbformat_minor": 0
597+
"nbformat_minor": 2
659598
}

0 commit comments

Comments
 (0)