{"id":13465280,"url":"https://github.com/philipturner/swift-colab","last_synced_at":"2025-03-25T16:31:36.246Z","repository":{"id":36984100,"uuid":"439478104","full_name":"philipturner/swift-colab","owner":"philipturner","description":"Swift kernel for Google Colaboratory","archived":false,"fork":false,"pushed_at":"2023-09-12T01:15:08.000Z","size":3819,"stargazers_count":102,"open_issues_count":4,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-07-31T15:01:25.363Z","etag":null,"topics":["colab","jupyter","linux","pythonkit","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philipturner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-12-17T22:45:32.000Z","updated_at":"2024-07-29T11:45:39.000Z","dependencies_parsed_at":"2024-01-02T23:44:16.372Z","dependency_job_id":"70fd9eab-972f-49de-b8a1-75f8abb3a343","html_url":"https://github.com/philipturner/swift-colab","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipturner%2Fswift-colab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipturner%2Fswift-colab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipturner%2Fswift-colab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philipturner%2Fswift-colab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philipturner","download_url":"https://codeload.github.com/philipturner/swift-colab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222088528,"owners_count":16928976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colab","jupyter","linux","pythonkit","swift"],"created_at":"2024-07-31T15:00:25.676Z","updated_at":"2024-10-29T17:30:38.197Z","avatar_url":"https://github.com/philipturner.png","language":"Swift","funding_links":[],"categories":["Editor Support","Swift","Guides and Learning"],"sub_categories":["Google Colaboratory"],"readme":"# Swift-Colab\n\n\u003e There is currently a major bug in Swift-Colab. See more [below](#colab-update-bug).\n\nIn March 2021, Google [ended](./Documentation/ColabSupportHistory.md) built-in Swift support on Colaboratory as part of the shutdown of [Swift for TensorFlow (S4TF)](https://github.com/tensorflow/swift). When new contributors temporarily revived S4TF, a Swift Colab kernel became essential for testing whether TPU acceleration still worked. This repository is the successor to [google/swift-jupyter](https://github.com/google/swift-jupyter), rewritten entirely in Swift.\n\nSwift-Colab is an accessible way to do programming with Swift. It runs in a browser, taking only 30 seconds to start up. It is perfect for programming on Chromebooks and tablets, which do not have the full functionality of a desktop. You can access a free NVIDIA GPU for machine learning and use the standard C bindings for OpenCL - instead of Python wrappers.\n\nFor an in-depth look at how and why this repository was created, check out the [summary of its history](./Documentation/ColabSupportHistory.md).\n\n- [Getting Started](#getting-started)\n- [Using Swift-Colab](#using-swift-colab)\n- [Installing Packages](#installing-packages)\n- [SwiftPlot Integration](#swiftplot-integration)\n- [Swift for TensorFlow Integration](#swift-for-tensorflow-integration)\n- [Swift Tutorials](#swift-tutorials)\n- [Testing](#testing)\n\n## Colab Update Bug\n\nRecently, Google upgraded Colab from Ubuntu 18.04 to Ubuntu 20.04. This coincided with upgrading the Python version from 3.7 to 3.8. Multiple things seem to have broken, one being the Swift LLDB interpreter. Upon calling `SBDebugger::Initialize()`, any code touching the CPython library will cause a silent crash. I cannot debug the crash because `stderr` is redirected to somewhere unknown in Colab.\n\nLuckily, Swift-Colab is still usable. Use Swift 5.6.2 instead of 5.7.3 and change the notebook's first cell to pull from the `main` branch. This can be accomplished by replacing the first cell with the following. Since the workaround breaks source compatibility, I will release a new Swift-Colab version once a full fix is found.\n\n```swift\n!curl \"https://raw.githubusercontent.com/philipturner/swift-colab/main/install_swift.sh\" --output \"install_swift.sh\"\n!bash \"install_swift.sh\" \"5.6.2\" #// Replace '5.7.3' with newest Swift version.\n```\n\n\u003c!--\n\n---\n\nThis repository does not currently run local Jupyter notebooks, but a future release will support [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/). In the meantime, [liuliu/swift-jupyter](https://github.com/liuliu/swift-jupyter) provides an actively maintained local notebook experience.\n\n\u003cdetails\u003e\n\u003csummary\u003eWhy use Swift-'Colab' for experiences outside of Colaboratory?\u003c/summary\u003e\n\n---\n\nSince [swift-jupyter](https://github.com/google/swift-jupyter) went unmaintained, Swift-Colab became the dominant \"source of truth\" for Jupyter notebook support. It's well-maintained and receives a high volume of internet traffic. Some users have tried running `install_swift.sh` on personal computers, with limited success. People will probably continue doing this despite the existence of [liuliu/swift-jupyter](https://github.com/liuliu/swift-jupyter). Furthermore, Swift-Colab's maintainer has a motive for supporting [JupyterLab](https://jupyterlab.readthedocs.io/en/stable/) (but not for supporting Docker\\*).\n\nLocal environments have faster CPUs than virtual machines, compiling Swift packages more quickly than Google Colaboratory. They can store data persistently, bypassing the bottleneck of Swift for TensorFlow's excessively long build time. Furthermore, they permit using your personal computer's GPU for machine learning (\u003cs\u003eonly with NVIDIA/CUDA\u003c/s\u003e an upcoming S4TF backend will support any Metal or OpenCL-capable GPU).\n\n\u003e \\*This presents a security risk: virtual machines encapsulate their code and stop it from harming the user's computer. When running vanilla JupyterLab, an ill-formed notebook could delete important files - in absence of proper security measures. Swift-Colab will harness any available mechanisms for limiting a process's access to the file system, and clearly document how it uses them.\n\u003e\n\u003e Docker does not provide access to the user's GPU, unless they have an NVIDIA GPU ([nvidia-docker](https://github.com/NVIDIA/nvidia-docker)). The maintainer wishes to make GPU acceleration accessible to all users, not favoring one specific platform over all others. If Docker could utilize non-NVIDIA GPUs, it would be viable and preferred to JupyterLab.\n\n\u003c/details\u003e\n\n--\u003e\n\n## Getting Started\n\nColab notebooks created directly from Google Drive are tailored for Python programming. When making a Swift notebook, copy the [official template](https://colab.research.google.com/drive/1EACIWrk9IWloUckRm3wu973bKUBXQDKR?usp=sharing) instead. It contains the commands listed below, which download and compile the Jupyter kernel. Run the first code cell and click `Runtime \u003e Restart runtime` in the menu bar.\n\n```swift\n!curl \"https://raw.githubusercontent.com/philipturner/swift-colab/release/latest/install_swift.sh\" --output \"install_swift.sh\"\n!bash \"install_swift.sh\" \"5.7.3\" #// Replace '5.7.3' with newest Swift version.\n```\n\n\u003e Tip: Colab measures how long you keep a notebook open without interacting with it. If you exceed the time limit of Colab's free tier, it may restart in Python mode. That means Swift code executes as if it's Python code. In that situation, repeat the process outlined above to return to Swift mode.\n\nTo automatically crash and restart the runtime, add the following line to the code cell. You can also restart the runtime with `Cmd/Ctrl + M + .`, so this [is not in](https://github.com/philipturner/swift-colab/pull/19) the template notebook.\n\n```swift\nimport os; import sys; sys.stdout.flush(); os.kill(os.getpid(), 9)\n```\n\nWhen Google sponsored S4TF from 2018 - 2021, the Swift community created several Jupyter notebooks. To run these notebooks now, slightly modify them. Create a new cell at the top of each notebook, including the commands shown above*. No further changes are necessary because of Swift-Colab's backward-compatibility. If you experience a problem, please [file an issue](https://github.com/philipturner/swift-colab/issues).\n\n\u003e \\*For a more future-proof solution, fill that cell with only a comment directing the user to Swift-Colab's repository. Whoever runs the notebook will likely not update the Swift version passed into `install_swift.sh`. I recommend this approach for the [fastai/swiftai](https://github.com/fastai/swiftai) notebooks and anything else that must be maintained indefinitely.\n\nThis repository contains a [growing list of tutorials](#swift-tutorials) sourced from [s4tf/s4tf-docs](https://github.com/s4tf/s4tf-docs) (formerly tensorflow/swift) and [fastai/swiftai](https://github.com/fastai/swiftai). Before following them, read through this README and familiarize yourself with the peculiarities of Swift-Colab.\n\n## Using Swift-Colab\n\nGoogle Colab is like the Swift REPL, but it submits several lines of code at once. Create a new cell with `Insert \u003e Code cell` and fill it with the first example below. Run it, and `64` appears in the output. No matter how many lines a cell has, only the last one's return value appears. To get around this restriction, use `print(...)` to display values.\n\n```swift\nInt.bitWidth\n// Output: (you can include this comment in the cell; it doesn't count as the \"last line\")\n// 64\n```\n\n```swift\nInt.bitWidth\nInt.bitWidth\n// Output:\n// 64\n```\n\n```swift\nprint(Int.bitWidth)\nInt.bitWidth\n// Output:\n// 64\n// 64\n```\n\nThe Swift kernel has several powerful features, including [magic commands](./Documentation/MagicCommands.md) and [Google Drive integration](./Documentation/GoogleDriveIntegration.md).\n\n## Installing Packages\n\nTo install a Swift package, type `%install` and a Swift 4.2-style package declaration. The declaration should appear between two single quotes. After that, enter the modules you want to compile. Before importing any module with a Swift `import` statement, execute its `%install` command. You can install packages in any cell, even after other Swift code has executed.\n\n```swift\n%install '.package(url: \"https://github.com/pvieito/PythonKit\", .branch(\"master\"))' PythonKit\n```\n\nUpon restarting the runtime, remember to rerun the `%install` command for each package. This command tells the Swift interpreter that the package is ready to be imported. It runs much more quickly than the first time through, because Swift-Colab utilizes cached build products from the previous Jupyter session. Try testing this mechanism by redundantly importing the same package. Make sure both commands match character-for-character!\n\n```swift\n%install '.package(url: \"https://github.com/pvieito/PythonKit\", .branch(\"master\"))' PythonKit\n%install '.package(url: \"https://github.com/pvieito/PythonKit\", .branch(\"master\"))' PythonKit\n```\n\n## SwiftPlot Integration\n\nTo use IPython graphs or SwiftPlot plots, enter the magic commands shown below. Include [`EnableIPythonDisplay.swift`](https://github.com/philipturner/swift-colab/blob/main/Sources/include/EnableIPythonDisplay.swift) after installing the Swift packages, because the file depends on both of them. SwiftPlot takes 23 seconds to compile, so you may skip its install command unless you intend to use it. However, you must restart the runtime if you change your mind.\n\n```swift\n%install '.package(url: \"https://github.com/pvieito/PythonKit\", .branch(\"master\"))' PythonKit\n%install '.package(url: \"https://github.com/KarthikRIyer/swiftplot\", .branch(\"master\"))' SwiftPlot AGGRenderer\n%include \"EnableIPythonDisplay.swift\"\n```\n\n`EnableIPythonDisplay.swift` injects the following code into the interpreter, gated under multiple import guards. The code samples here do not explicitly import these libraries, as doing so would be redundant. If you do not include `EnableIPythonDisplay.swift`, explicitly import them before running other Swift code.\n\n```swift\nimport PythonKit\nimport SwiftPlot\nimport AGGRenderer\n```\n\nFor tutorials on using the SwiftPlot API, check out [KarthikRIyer/swiftplot](https://github.com/KarthikRIyer/swiftplot).\n\n## Swift for TensorFlow Integration\n\nS4TF has a quite complex build setup. The easiest way to use it is copying the [S4TF test notebook](https://colab.research.google.com/drive/1v3ZhraaHdAS2TGj03hE0cK-KRFzsqxO1?usp=sharing) into your Google Drive. To configure it manually, read the instructions below.\n\n\u003e Swift 5.7 has been released, so this section is out of date.\n\nSwift for TensorFlow does not compile on Linux release toolchains, so select a Swift development toolchain. Visit [swift.org/download](https://www.swift.org/download) and scroll to \"Trunk Development (main)\". Note the date next to \"Ubuntu 18.04\" - at the time of writing, July 20, 2022. At the top of your Colab notebook, the first code cell says \"Replace 5.6.2 with newest Swift version.\" Delete the `\"5.6.2\"` after `\"install_swift.sh\"` and enter the snapshot's date in YYYY-MM-DD format.\n\n```swift\n!bash \"install_swift.sh\" \"2022-07-20\" #// Replace 5.7 with newest Swift version.\n```\n\nYou can easily download trunk snapshots by pasting their date. For other toolchains, the entire URL must be present. The code below downloads the July 5, 2022 snapshot from Swift's `release/5.7` branch. Do not enter it into the notebook; it is only here for reference.\n\n```swift\n!bash \"install_swift.sh\" \"https://download.swift.org/swift-5.7-branch/ubuntu1804/swift-5.7-DEVELOPMENT-SNAPSHOT-2022-07-05-a/swift-5.7-DEVELOPMENT-SNAPSHOT-2022-07-05-a-ubuntu18.04.tar.gz\" #// Replace 5.7 with newest Swift version.\n```\n\nExecute the installation script and go to `Runtime \u003e Restart runtime`. Next, download the X10 binary created from [tensorflow/tensorflow](https://github.com/tensorflow/tensorflow) and the C++ code in [s4tf/s4tf](https://github.com/s4tf/s4tf). Paste the commands below into a unique code cell, which you only run once. Do not add anything else to this cell.\n\n```swift\n%system curl \"https://storage.googleapis.com/swift-tensorflow-artifacts/oneoff-builds/tensorflow-ubuntu1804-cuda11-x86.zip\" --output \"x10-binary.zip\"\n%system unzip \"x10-binary.zip\"\n%system cp -r \"/content/Library/tensorflow-2.4.0/usr/include/tensorflow\" \"/usr/include/tensorflow\"\n```\n\nTop-of-tree S4TF is currently tested against TensorFlow 2.9, as shown in the [S4TF build script](https://gist.github.com/philipturner/7aa063af04277d463c14168275878511). The script does not yet run on every platform and a major [XLA bug](https://github.com/s4tf/s4tf/issues/14) exists, so I cannot host modern X10 binaries online. The previous command downloaded the last X10 binary that Google created, which uses TF 2.4. Using an outdated binary [brings some caveats](https://github.com/s4tf/s4tf/pull/16), as the raw TensorFlow bindings were recently [updated for v2.9](https://github.com/s4tf/s4tf/pull/10). As a rule of thumb, avoid the `_Raw` namespace.\n\nNow, the real action begins. [s4tf/s4tf](https://github.com/s4tf/s4tf) takes 3 minutes to compile on Google Colab, which sounds worse than it is. Swift-Colab 2.0 made this a one-time cost, so the package rebuilds instantaneously after restarting the runtime. Grab a cup of coffee or read a Medium article while it compiles, and that's the only waiting you ever need to do. If you accidentally close the browser tab with S4TF loaded, salvage it with `Runtime \u003e Manage sessions`.\n\n\u003e To access your closed notebook, first open a new notebook. `Runtime \u003e Manage sessions` shows a list of active Colab sessions. Click on the closed notebook's name, and it opens in a new browser tab.\n\nGo to `Insert \u003e Code cell` and paste the following commands. The SwiftPM flags `-c release -Xswiftc -Onone` are commented out. They shorten build time to 2 minutes, but require [restarting the runtime twice](https://github.com/philipturner/swift-colab/issues/15) because of a [compiler bug](https://github.com/apple/swift/issues/59569). Consider using these flags if compile time becomes a serious bottleneck in your workflow.\n\n```swift\n%install-swiftpm-flags $clear\n// %install-swiftpm-flags -c release -Xswiftc -Onone\n%install-swiftpm-flags -Xlinker \"-L/content/Library/tensorflow-2.4.0/usr/lib\"\n%install-swiftpm-flags -Xlinker \"-rpath=/content/Library/tensorflow-2.4.0/usr/lib\"\n%install '.package(url: \"https://github.com/s4tf/s4tf\", .branch(\"main\"))' TensorFlow\n```\n\nFinally, import Swift for TensorFlow into the interpreter.\n\n```swift\nimport TensorFlow\n```\n\n## Swift Tutorials\n\nTutorial notebooks do not include commands for installing Swift-Colab; you must add the commands described in [Getting Started](#getting-started). They also depend on modules such as PythonKit and TensorFlow, which were previously part of custom S4TF toolchains. We now use stock toolchains, so download the packages as described in [Installing Packages](#installing-packages) and [Swift for TensorFlow Integration](#swift-for-tensorflow-integration). For tutorials that involve automatic differentiation, either use [Differentiation](https://github.com/philipturner/differentiation) or download a development toolchain.\n\nMultiple tutorial notebooks depend on Swift for TensorFlow. \u003cs\u003eYou must recompile the Swift package in each notebook, waiting 3 minutes each time.\u003c/s\u003e Save time by compiling S4TF in one Colab instance, then reusing it for multiple tutorials. To start, open up the [Swift for TensorFlow test notebook](https://colab.research.google.com/drive/1v3ZhraaHdAS2TGj03hE0cK-KRFzsqxO1?usp=sharing). Append the commands below to the cell that compiles S4TF. When S4TF starts building, read the rest of these instructions.\n\n```swift\n%install-swiftpm-flags $clear\n%install '.package(url: \"https://github.com/pvieito/PythonKit\", .branch(\"master\"))' PythonKit\nimport _Differentiation // If using a development toolchain.\n\n// If using a release toolchain.\n// %install '.package(url: \"https://github.com/philipturner/differentiation\", .branch(\"main\"))' _Differentiation\n// import Differentiation\n```\n\nIn another browser tab, open one of the tutorials. Click `Edit \u003e Select all cells` in the menu bar. Every cell should turn blue. Press `Cmd/Ctrl + C` to copy the cells. Switch back to the original Colab notebook and click the last cell. Press `Cmd/Ctrl + V`. Every cell from the tutorial should appear in the notebook that is compiling S4TF.\n\nWhen following a tutorial for the first time, run its cells one by one. To run all of them at once, click the first code cell of the tutorial. Then, go to `Runtime \u003e Run after`. If you are lucky, the cells can be deleted with `Edit \u003e Undo insert X cells`. Otherwise, select all cells, delete them, and paste the contents of the [S4TF test notebook]((https://colab.research.google.com/drive/1v3ZhraaHdAS2TGj03hE0cK-KRFzsqxO1?usp=sharing)). After resetting the notebook, go to `Runtime \u003e Restart runtime`. Rerun the cell that installs TensorFlow and PythonKit, which should take 4 seconds to execute. Proceed with the second tutorial.\n\nIn the table below, \"Compatible Swift Versions\" lists whether each notebook runs under the latest release or development toolchain.\n- Release = 5.6.2 Release\n- Development = July 20, 2022 Development Snapshot\n\n| Tutorials from Google | Dependencies | Compatible Swift Versions |\n| --------------------- | ------------ | ------------------------- |\n| [A Swift Tour](https://colab.research.google.com/github/tensorflow/swift/blob/main/docs/site/tutorials/a_swift_tour.ipynb) | | Release, Development |\n| [Protocol-Oriented Programming \u0026 Generics](https://colab.research.google.com/github/tensorflow/swift/blob/main/docs/site/tutorials/protocol_oriented_generics.ipynb) | | Release, Development |\n| [Python Interoperability](https://colab.research.google.com/github/tensorflow/swift/blob/main/docs/site/tutorials/python_interoperability.ipynb)\u003csup\u003e[1]\u003c/sup\u003e | PythonKit, S4TF\u003csup\u003e[2]\u003c/sup\u003e | Release, Development |\n| [Sharp Edges in Differentiability](https://colab.research.google.com/github/tensorflow/swift/blob/main/docs/site/tutorials/Swift_autodiff_sharp_edges.ipynb)\u003csup\u003e[3][4]\u003c/sup\u003e | Differentiation | Release, Development |\n| [Model Training Walkthrough](https://colab.research.google.com/github/tensorflow/swift/blob/main/docs/site/tutorials/model_training_walkthrough.ipynb) | Differentiation, PythonKit, S4TF | Development |\n| [Raw TensorFlow Operators](https://colab.research.google.com/github/tensorflow/swift/blob/main/docs/site/tutorials/raw_tensorflow_operators.ipynb) | Differentiation, S4TF | Development |\n| [Introducing X10, an XLA-Based Backend](https://colab.research.google.com/github/tensorflow/swift/blob/main/docs/site/tutorials/introducing_x10.ipynb)\u003csup\u003e[5]\u003c/sup\u003e | S4TF, [S4TF Models](https://github.com/s4tf/models) | n/a |\n\n\u003e \u003csup\u003e1\u003c/sup\u003eOne cell fails because of ambiguous overloads for `PythonObject.==` and `PythonObject.\u003c`. Work around this by explicitly casting the comparison result to `Bool` before printing.\n\u003e\n\u003e \u003csup\u003e2\u003c/sup\u003eWhen using release toolchains, skip the cell that contains `Tensor\u003cFloat\u003e`.\n\u003e\n\u003e \u003csup\u003e3\u003c/sup\u003eSeveral cells fail because `gradient(at:in)` was renamed to `gradient(at:of:)`. Fix the second argument label and rerun the failed cells.\n\u003e\n\u003e \u003csup\u003e4\u003c/sup\u003eOne cell fails because of the ambiguous line `gradient(at: 2, 2, of: pow)`. Fix this by replacing either `2` with `Double(2)`.\n\u003e\n\u003e \u003csup\u003e5\u003c/sup\u003eThis notebook depends on [tensorflow/swift-models](https://github.com/tensorflow/swift-models), which is now maintained at [s4tf/models](https://github.com/s4tf/models). The repository has not been tested recently. Also, compilation requires using `%install-swiftpm-import` to inject the `TensorFlow` module.\n\n\u003c!--\n\n| Tutorials from FastAI | Dependencies | Compatible Swift Versions |\n| --------------------- | ------------ | ------------------------- |\n| n/a | S4TF | n/a |\n\nThe Swift community made the following tutorials without sponsorship from Google. These do not import S4TF, so close the common Colab instance that ran previous tutorials. Execute each tutorial below in its original notebook, which may be pre-configured for GPU acceleration. Click `Runtime \u003e Disconnect and delete runtime` after completing each tutorial. Otherwise, Google may temporarily restrict your access to accelerators for overusing them.\n\nFor those looking to showcase Swift libraries in Jupyter/Colaboratory: contributions are welcome. Notebooks submitted in [issues](https://github.com/philipturner/swift-colab/issues) will be reviewed and accepted. DocC tutorials are also permissible; Swift-Colab's maintainer will either convert them into Jupyter notebooks or redirect users to the documentation website.\n\n| Community Tutorials | Dependencies | Compatible Swift Versions |\n| ------------------- | ------------ | ------------------------- |\n| Google Drive Integration\u003csup\u003e6\u003c/sup\u003e | PythonKit | Release, Development |\n| Simulating 3D Physics\u003csup\u003e7\u003c/sup\u003e | [MuJoCo](https://github.com/deepmind/mujoco) | Release, Development |\n| General-Purpose GPU with OpenCL\u003csup\u003e7\u003c/sup\u003e | [SwiftOpenCL](https://github.com/philipturner/swift-opencl) | Release, Development |\n\n--\u003e\n\n\u003c!-- \"Google Drive Integration\" tutorial - offloads the explanation from this README, shows an interactive experience. Create a scratch Google account, mount the drive, experience compiling SwiftPlot more quickly, caching multiple build configurations. Notify FastAI forums once released. --\u003e\n\n\u003c!-- Maintain the existing S4TF build optimization hack, but nest it inside a dropdown. Encourage people to use Google Drive instead. --\u003e\n\n\u003c!--\n\n\u003e \u003csup\u003e6\u003c/sup\u003eWill be released as part of Swift-Colab v2.3.\n\u003e\n\u003e \u003csup\u003e7\u003c/sup\u003eStill in development. Upon completion, the title will become a hyperlink.\n\n--\u003e\n\n## Testing\n\nThese tests ensure that Swift-Colab runs on recent Swift toolchains. Some of them originate from [unit tests](https://github.com/google/swift-jupyter/tree/main/test/tests) in swift-jupyter, while others cover fixed bugs and third-party libraries. If any notebook fails or you have a suggestion for a new test, please [open an issue](https://github.com/philipturner/swift-colab/issues).\n\nTo run a test, replace `\"5.7\"` in the first code cell with the newest Swift version. Run the installation commands, then go to `Runtime \u003e Restart runtime`. Click on the second code cell and instruct Colab to execute every cell in the notebook (`Runtime \u003e Run after`). Compare each cell's expected output with its actual output. If additional instructions appear at the top of the notebook, read them before running the test.\n\n\u003c!-- Emoji shortcuts for reference: ✅ ❌ --\u003e\n\n| Test | Passing | Date of Last Test Run | Swift Version |\n| ---- | ------- | --------------------- | ------------- |\n| [Swift Kernel Tests](https://colab.research.google.com/drive/1vooU1XVHSpolOSmVUKM4Wj6opEJBt7zs?usp=sharing) | ✅ | October 2022 | 5.7 Release |\n| [Own Kernel Tests](https://colab.research.google.com/drive/1nHitEZm9QZNheM-ALajARyRZY2xpZr00?usp=sharing) | ✅ | October 2022 | 5.7 Release |\n| [Simple Notebook Tests](https://colab.research.google.com/drive/18316eFVMw-NIlA9OandB7djvp0J4jI0-?usp=sharing) | ✅ | October 2022 | 5.7 Release |\n| [SwiftPlot](https://colab.research.google.com/drive/1Rxs7OfuKIJ_hAm2gUQT2gWSuIcyaeZfz?usp=sharing) | ✅ | October 2022 | 5.7 Release\n| [Swift for TensorFlow](https://colab.research.google.com/drive/1v3ZhraaHdAS2TGj03hE0cK-KRFzsqxO1?usp=sharing) | ✅ | August 2022 | August 9, 2022 Development Snapshot |\n| [Concurrency](https://colab.research.google.com/drive/1du6YzWL9L_lbjoLl8qvrgPvyZ_8R7MCq?usp=sharing) | ✅ | October 2022 | 5.7 Release |\n| [TPU Tests](https://colab.research.google.com/drive/1DfkbU_JQnSw1_xLAlDyDvDT3S1G45i6d?usp=sharing) | ✅ | July 2022 | July 5, 2022 v5.7 Development Snapshot |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipturner%2Fswift-colab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilipturner%2Fswift-colab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilipturner%2Fswift-colab/lists"}