{"id":5646642,"date":"2022-09-13T12:56:13","date_gmt":"2022-09-13T16:56:13","guid":{"rendered":"https:\/\/lightning.ai\/pages\/?p=5646642"},"modified":"2023-03-07T17:35:42","modified_gmt":"2023-03-07T22:35:42","slug":"apple-silicon-pytorch","status":"publish","type":"post","link":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/","title":{"rendered":"How to Enable GPU-Accelerated Training on Apple Silicon in PyTorch"},"content":{"rendered":"<h2>Support for Apple Silicon Processors in PyTorch, with Lightning<\/h2>\n<h3><em><strong>tl;dr\u00a0<\/strong><\/em>this tutorial shows you how to train models faster with Apple&#8217;s M1 or M2 chips.<\/h3>\n<p>With the release of PyTorch 1.12 in May of this year, PyTorch added <span style=\"color: #635ed9;\"><a style=\"color: #635ed9;\" href=\"https:\/\/pytorch.org\/blog\/introducing-accelerated-pytorch-training-on-mac\/\">experimental support for the Apple Silicon<\/a><\/span> processors through the Metal Performance Shaders (MPS) backend. If you own an Apple computer with an M1 or M2 chip and have the latest version of PyTorch installed, you can now train models faster.<\/p>\n<p>You can use the MPS device in PyTorch like so:<\/p>\n<script src=\"https:\/\/gist.github.com\/78ca7871efbf59576713b429db083e7d.js\"><\/script>\n<p>Even better news: in the latest 1.7 release of PyTorch Lightning, we made it super easy to switch to the MPS backend without any code changes!<\/p>\n<script src=\"https:\/\/gist.github.com\/ff5ba50c68fe328d0b256355b0d0e3aa.js\"><\/script>\n<p>Support for this accelerator is currently marked as\u00a0<strong>experimental<\/strong>\u00a0in PyTorch. Because many <span style=\"color: #635ed9;\"><a style=\"color: #635ed9;\" href=\"https:\/\/github.com\/pytorch\/pytorch\/issues\/77764\">operators are still missing<\/a><\/span>, you may run into a few rough edges. PyTorch and Lightning will continue to improve support for Apple Silicon, so stay tuned for future releases!<\/p>\n<p>The PyTorch team itself has run extensive benchmarks using the MPS backend and demonstrate significant speedups over the CPU version.<\/p>\n<div id=\"attachment_5646643\" style=\"width: 1534px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-5646643\" class=\"wp-image-5646643 size-full\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M1-Speed.png\" alt=\"\" width=\"1524\" height=\"980\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M1-Speed.png 1524w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M1-Speed-300x193.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M1-Speed-1024x658.png 1024w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M1-Speed-600x386.png 600w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M1-Speed-600x386@2x.png 1200w\" sizes=\"(max-width: 1524px) 100vw, 1524px\" \/><p id=\"caption-attachment-5646643\" class=\"wp-caption-text\">PyTorch shows the speedup MPS brings compared to running on CPU. Source: pytorch.org<\/p><\/div>\n<p>Since the initial release in May, the community has published more performance benchmarks with various devices and models, for example:<\/p>\n<ul>\n<li><span style=\"color: #635ed9;\"><a style=\"color: #635ed9;\" href=\"https:\/\/sebastianraschka.com\/blog\/2022\/pytorch-m1-gpu.html#my-benchmarks\">VGG on CIFAR by Sebastian Raschka<\/a><\/span><\/li>\n<li><span style=\"color: #635ed9;\"><a style=\"color: #635ed9;\" href=\"https:\/\/wandb.ai\/capecape\/pytorch-M1Pro\/reports\/PyTorch-Runs-On-the-GPU-of-Apple-M1-Macs-Now-Announcement-With-Code-Samples---VmlldzoyMDMyNzMz#for-nlp-let's-try-bert-training\">Benchmark for NLP models (BERT) by WandB<\/a><\/span><\/li>\n<\/ul>\n<h2>Does My Mac Support It?<\/h2>\n<p>It is easy to find out if your Mac has an M1 or M2 chip inside. In the top left corner of your screen, click the Apple symbol and go to \u201cAbout This Mac\u201d.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5646644 size-full\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/About-This-Mac.png\" alt=\"\" width=\"888\" height=\"820\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/About-This-Mac.png 888w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/About-This-Mac-300x277.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/About-This-Mac-600x554.png 600w\" sizes=\"(max-width: 888px) 100vw, 888px\" \/><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5646645 size-full\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Overview.png\" alt=\"\" width=\"1396\" height=\"888\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Overview.png 1396w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Overview-300x191.png 300w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Overview-1024x651.png 1024w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Overview-600x382.png 600w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Overview-600x382@2x.png 1200w\" sizes=\"(max-width: 1396px) 100vw, 1396px\" \/><\/p>\n<p>In the popup window, you see a summary of your Mac including the chip name. If it says M1 or M2, you can run PyTorch and Lightning code using the MPS backend!<\/p>\n<p>Important before you install Lightning and\/or PyTorch: If you are using <span style=\"color: #635ed9;\"><a style=\"color: #635ed9;\" href=\"https:\/\/www.anaconda.com\/products\/distribution\">Anaconda<\/a><\/span>\/<span style=\"color: #635ed9;\"><a style=\"color: #635ed9;\" href=\"https:\/\/docs.conda.io\/en\/latest\/miniconda.html#latest-miniconda-installer-links\">Miniconda<\/a><\/span> for your virtual environments, you should select the Apple M1 installation, not \u201cIntel\u201d. Otherwise, you won\u2019t be able to use the MPS backend in PyTorch (and Lightning). Here is a simple check to make sure your Python isn\u2019t getting tricked:<\/p>\n<script src=\"https:\/\/gist.github.com\/2b2a350f8c8502a6e8d73f2f8edeb503.js\"><\/script>\n<p>If this prints \u201carm\u201d, you\u2019re good! If it returns \u201ci386\u201d, that means Python thinks you are on an Intel processor, and that\u2019s no good! In this case, you should re-install your conda with ARM support.<\/p>\n<h2>How Does Apple Silicon Work?<\/h2>\n<p>Apple Silicon refers to Apple\u2019s new system on a chip (SoC) processors launched in late 2020. SoC is a design that puts all the important devices in a computer onto a single chip, this includes: the main CPU cores, the GPU (for graphics and AI), a shared memory that all components can access directly, I\/O controllers, storage controllers, and so on. Because all these components are on a single chip and and very close together, the circuits can be tightly integrated and optimized for better performance.<\/p>\n<div id=\"attachment_5646646\" style=\"width: 1090px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-5646646\" class=\"size-full wp-image-5646646\" src=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M2-Chip.jpeg\" alt=\"\" width=\"1080\" height=\"1280\" srcset=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M2-Chip.jpeg 1080w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M2-Chip-253x300.jpeg 253w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M2-Chip-864x1024.jpeg 864w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M2-Chip-600x711.jpeg 600w, https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-M2-Chip-253x300@2x.jpeg 506w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/><p id=\"caption-attachment-5646646\" class=\"wp-caption-text\">Apple M2 Chip inside the MacBook Pro 13. Source: Apple<\/p><\/div>\n<p>Among the components on this chip is Apple\u2019s Metal GPU, and its main purpose is for rendering graphics to the screen. However, GPU cores can also be accessed by applications for general purposes, and are especially useful when computations can be parallelized to a high degree, such as in a tensor library like PyTorch! This is what the MPS backend does: It maps all torch operations (matrix multiplication, convolution, etc.) in your computational graph to special kernels implemented in Apple\u2019s Metal shader language.<\/p>\n<p>PyTorch has already integrated the kernels for many common operations, but not all of them yet. It will take some time until <span style=\"color: #635ed9;\"><a style=\"color: #635ed9;\" href=\"https:\/\/github.com\/pytorch\/pytorch\/issues\/77764\">this effort<\/a> <\/span>is completed, so stay tuned for future updates.<\/p>\n<p>If you are running into issues with unsupported ops, you can try to upgrade the PyTorch package to the nightly version by selecting \u201cPreview (Nightly)\u201d on the <span style=\"color: #635ed9;\"><a style=\"color: #635ed9;\" href=\"https:\/\/pytorch.org\/\">PyTorch website<\/a><\/span>, which should come with more improvements to MPS support.<\/p>\n<h2>Conclusion<\/h2>\n<p>We hope that users who rock a Mac M1 or M2 model get a kick out of this release! With the latest advancements in PyTorch and Lightning, you can develop models even faster right on your laptop, without the boilerplate. And when it is time to crank things up a notch, remember that <span style=\"color: #635ed9;\"><a style=\"color: #635ed9;\" href=\"https:\/\/lightning.ai\/\">Lightning AI<\/a> <\/span>has got you covered: It is easier than ever to bring your models to the cloud to train and deploy at scale, on beefy hardware that will crush your M1 Max.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Support for Apple Silicon Processors in PyTorch, with Lightning tl;dr\u00a0this tutorial shows you how to train models faster with Apple&#8217;s M1 or M2 chips. With the release of PyTorch 1.12 in May of this year, PyTorch added experimental support for the Apple Silicon processors through the Metal Performance Shaders (MPS) backend. If you own an<a class=\"excerpt-read-more\" href=\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/\" title=\"ReadHow to Enable GPU-Accelerated Training on Apple Silicon in PyTorch\">&#8230; Read more &raquo;<\/a><\/p>\n","protected":false},"author":16,"featured_media":5646679,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":"","_links_to":"","_links_to_target":""},"categories":[41],"tags":[],"glossary":[],"acf":{"additional_authors":false,"hide_from_archive":false,"content_type":"Blog Post","custom_styles":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Enable Training on Apple Silicon Processors in PyTorch<\/title>\n<meta name=\"description\" content=\"This tutorial shows you how to enable GPU-accelerated training on Apple Silicon&#039;s processors in PyTorch with Lightning.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Enable Training on Apple Silicon Processors in PyTorch\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you how to enable GPU-accelerated training on Apple Silicon&#039;s processors in PyTorch with Lightning.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/\" \/>\n<meta property=\"og:site_name\" content=\"Lightning AI\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-13T16:56:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-07T22:35:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-Silicon.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2320\" \/>\n\t<meta property=\"og:image:height\" content=\"1200\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"JP Hennessy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"Enable Training on Apple Silicon Processors in PyTorch\" \/>\n<meta name=\"twitter:description\" content=\"This tutorial shows you how to enable GPU-accelerated training on Apple Silicon&#039;s processors in PyTorch with Lightning.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-Silicon.png\" \/>\n<meta name=\"twitter:creator\" content=\"@LightningAI\" \/>\n<meta name=\"twitter:site\" content=\"@LightningAI\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"JP Hennessy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/\"},\"author\":{\"name\":\"JP Hennessy\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6\"},\"headline\":\"How to Enable GPU-Accelerated Training on Apple Silicon in PyTorch\",\"datePublished\":\"2022-09-13T16:56:13+00:00\",\"dateModified\":\"2023-03-07T22:35:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/\"},\"wordCount\":786,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/ASilicon.png\",\"articleSection\":[\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/\",\"url\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/\",\"name\":\"Enable Training on Apple Silicon Processors in PyTorch\",\"isPartOf\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/ASilicon.png\",\"datePublished\":\"2022-09-13T16:56:13+00:00\",\"dateModified\":\"2023-03-07T22:35:42+00:00\",\"description\":\"This tutorial shows you how to enable GPU-accelerated training on Apple Silicon's processors in PyTorch with Lightning.\",\"breadcrumb\":{\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#primaryimage\",\"url\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/ASilicon.png\",\"contentUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/ASilicon.png\",\"width\":1160,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/lightning.ai\/pages\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Enable GPU-Accelerated Training on Apple Silicon in PyTorch\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/lightning.ai\/pages\/#website\",\"url\":\"https:\/\/lightning.ai\/pages\/\",\"name\":\"Lightning AI\",\"description\":\"The platform for teams to build AI.\",\"publisher\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/lightning.ai\/pages\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/lightning.ai\/pages\/#organization\",\"name\":\"Lightning AI\",\"url\":\"https:\/\/lightning.ai\/pages\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png\",\"contentUrl\":\"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png\",\"width\":1744,\"height\":856,\"caption\":\"Lightning AI\"},\"image\":{\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/LightningAI\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6\",\"name\":\"JP Hennessy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/lightning.ai\/pages\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g\",\"caption\":\"JP Hennessy\"},\"url\":\"https:\/\/lightning.ai\/pages\/author\/jplightning-ai\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Enable Training on Apple Silicon Processors in PyTorch","description":"This tutorial shows you how to enable GPU-accelerated training on Apple Silicon's processors in PyTorch with Lightning.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/","og_locale":"en_US","og_type":"article","og_title":"Enable Training on Apple Silicon Processors in PyTorch","og_description":"This tutorial shows you how to enable GPU-accelerated training on Apple Silicon's processors in PyTorch with Lightning.","og_url":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/","og_site_name":"Lightning AI","article_published_time":"2022-09-13T16:56:13+00:00","article_modified_time":"2023-03-07T22:35:42+00:00","og_image":[{"width":2320,"height":1200,"url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-Silicon.png","type":"image\/png"}],"author":"JP Hennessy","twitter_card":"summary_large_image","twitter_title":"Enable Training on Apple Silicon Processors in PyTorch","twitter_description":"This tutorial shows you how to enable GPU-accelerated training on Apple Silicon's processors in PyTorch with Lightning.","twitter_image":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/Apple-Silicon.png","twitter_creator":"@LightningAI","twitter_site":"@LightningAI","twitter_misc":{"Written by":"JP Hennessy","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#article","isPartOf":{"@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/"},"author":{"name":"JP Hennessy","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6"},"headline":"How to Enable GPU-Accelerated Training on Apple Silicon in PyTorch","datePublished":"2022-09-13T16:56:13+00:00","dateModified":"2023-03-07T22:35:42+00:00","mainEntityOfPage":{"@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/"},"wordCount":786,"commentCount":0,"publisher":{"@id":"https:\/\/lightning.ai\/pages\/#organization"},"image":{"@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#primaryimage"},"thumbnailUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/ASilicon.png","articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/","url":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/","name":"Enable Training on Apple Silicon Processors in PyTorch","isPartOf":{"@id":"https:\/\/lightning.ai\/pages\/#website"},"primaryImageOfPage":{"@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#primaryimage"},"image":{"@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#primaryimage"},"thumbnailUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/ASilicon.png","datePublished":"2022-09-13T16:56:13+00:00","dateModified":"2023-03-07T22:35:42+00:00","description":"This tutorial shows you how to enable GPU-accelerated training on Apple Silicon's processors in PyTorch with Lightning.","breadcrumb":{"@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#primaryimage","url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/ASilicon.png","contentUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2022\/09\/ASilicon.png","width":1160,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/lightning.ai\/pages\/community\/tutorial\/apple-silicon-pytorch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/lightning.ai\/pages\/"},{"@type":"ListItem","position":2,"name":"How to Enable GPU-Accelerated Training on Apple Silicon in PyTorch"}]},{"@type":"WebSite","@id":"https:\/\/lightning.ai\/pages\/#website","url":"https:\/\/lightning.ai\/pages\/","name":"Lightning AI","description":"The platform for teams to build AI.","publisher":{"@id":"https:\/\/lightning.ai\/pages\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/lightning.ai\/pages\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/lightning.ai\/pages\/#organization","name":"Lightning AI","url":"https:\/\/lightning.ai\/pages\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/","url":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png","contentUrl":"https:\/\/lightningaidev.wpengine.com\/wp-content\/uploads\/2023\/02\/image-17.png","width":1744,"height":856,"caption":"Lightning AI"},"image":{"@id":"https:\/\/lightning.ai\/pages\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/LightningAI"]},{"@type":"Person","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/2518f4d5541f8e98016f6289169141a6","name":"JP Hennessy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/lightning.ai\/pages\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/28ade268218ae45f723b0b62499f527a?s=96&d=mm&r=g","caption":"JP Hennessy"},"url":"https:\/\/lightning.ai\/pages\/author\/jplightning-ai\/"}]}},"_links":{"self":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts\/5646642"}],"collection":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/comments?post=5646642"}],"version-history":[{"count":0,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/posts\/5646642\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/media\/5646679"}],"wp:attachment":[{"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/media?parent=5646642"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/categories?post=5646642"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/tags?post=5646642"},{"taxonomy":"glossary","embeddable":true,"href":"https:\/\/lightning.ai\/pages\/wp-json\/wp\/v2\/glossary?post=5646642"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}