|
19 | 19 | "source": [ |
20 | 20 | "## **Installation**\n", |
21 | 21 | "Requirements:\n", |
22 | | - "- python >= 3.7\n", |
| 22 | + "- python >= 3.9\n", |
23 | 23 | "\n", |
24 | 24 | "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", |
60 | 27 | "Installing TorchRec will also install [FBGEMM](https://github.com/pytorch/fbgemm), a collection of CUDA kernels and GPU enabled operations to run " |
61 | 28 | ] |
62 | 29 | }, |
63 | 30 | { |
64 | 31 | "cell_type": "code", |
65 | 32 | "execution_count": null, |
66 | 33 | "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" |
109 | 35 | }, |
110 | 36 | "outputs": [], |
111 | 37 | "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" |
114 | 42 | ] |
115 | 43 | }, |
116 | 44 | { |
|
625 | 553 | } |
626 | 554 | ], |
627 | 555 | "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 | + } |
648 | 590 | }, |
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 |
656 | 595 | }, |
657 | 596 | "nbformat": 4, |
658 | | - "nbformat_minor": 0 |
| 597 | + "nbformat_minor": 2 |
659 | 598 | } |
0 commit comments