{"id":23673879,"url":"https://github.com/carpentries-incubator/gpu-speedups","last_synced_at":"2025-09-11T23:43:29.758Z","repository":{"id":71426446,"uuid":"255728355","full_name":"carpentries-incubator/gpu-speedups","owner":"carpentries-incubator","description":"GPU Speedups in Python","archived":false,"fork":false,"pushed_at":"2020-05-29T20:55:27.000Z","size":2359,"stargazers_count":2,"open_issues_count":3,"forks_count":2,"subscribers_count":6,"default_branch":"gh-pages","last_synced_at":"2024-12-29T12:57:44.389Z","etag":null,"topics":["carpentries-incubator","english","gpu","lesson","pre-alpha","python"],"latest_commit_sha":null,"homepage":"https://carpentries-incubator.github.io/gpu-speedups/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carpentries-incubator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["carpentries"],"custom":["https://give.communityin.org/TheCarpentries"]}},"created_at":"2020-04-14T21:16:53.000Z","updated_at":"2023-06-05T02:25:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"97d15ffa-45cd-4b24-b01b-08a6a7ef6c9c","html_url":"https://github.com/carpentries-incubator/gpu-speedups","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carpentries-incubator%2Fgpu-speedups","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carpentries-incubator%2Fgpu-speedups/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carpentries-incubator%2Fgpu-speedups/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carpentries-incubator%2Fgpu-speedups/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carpentries-incubator","download_url":"https://codeload.github.com/carpentries-incubator/gpu-speedups/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239705981,"owners_count":19683760,"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":["carpentries-incubator","english","gpu","lesson","pre-alpha","python"],"created_at":"2024-12-29T12:57:11.040Z","updated_at":"2025-02-19T17:41:49.311Z","avatar_url":"https://github.com/carpentries-incubator.png","language":"Python","funding_links":["https://github.com/sponsors/carpentries","https://give.communityin.org/TheCarpentries"],"categories":[],"sub_categories":[],"readme":"[![Create a Slack Account with us](https://img.shields.io/badge/Create_Slack_Account-The_Carpentries-071159.svg)](https://swc-slack-invite.herokuapp.com/)\n\n# GPU Speedups in Python\n\nThis lesson explores how to parallelize Python code with GPU speedups. There are a number of ways to do this, and some methods overlap with others.\n\n## Audience\nThe intended audience are people familiar with Python, the python library `numpy`, and that have some initial familiarity with the ideas behind parallelization in computer programming. \n\n\n## Why GPUs?\nMany computational problems are parallelizable and can be sped up 10-1000 times on the GPU. Suitable computations are doing the same thing to pieces of 1000s - trillions of pieces of data (records, samples, entries, etc).\n\nLet's think of a familiar example: the average. An average of numbers stored in a vector can be computed by accumulating these numbers in one spot, and then dividing by the total number. The average does not depend on what order they are added together in, and no number \"speaks\" to another number. A for loop could do this, but why use a loop? Every pass through the loop is independent of each other. What if all the passes through the loops could be done at the same time? If you have problems like these, GPU speedups can pay off.\n\nPython already has libraries for vectorized problems, like numpy. However, much of this code is actually a low level (eg in C) implementation that is non paralleled, but just loop really fast. There is overhead transferring data to the GPU, but if the computation is complicated enough, then doing it on the GPU can be worth it.\n\nAlso, some problems are not (easily) vectorizable or written as fast Numpy ufuncs. For example, each sub computation is independent, but you need some if/else clauses and can't put this into a matrix. If you cannot write down the problem as a series of matrix operations, but can write out what to do in each case, then you can code a kernel function that the GPU cores execute. There are 1000s of GPU cores on a single GPU device, unlike dozens of CPUs.\n\n## Contributing\n\nWe welcome all contributions to improve the lesson! Maintainers will do their best to help you if you have any\nquestions, concerns, or experience any difficulties along the way.\n\nWe'd like to ask you to familiarize yourself with our [Contribution Guide](CONTRIBUTING.md) and have a look at\nthe [more detailed guidelines][lesson-example] on proper formatting, ways to render the lesson locally, and even\nhow to write new episodes.\n\nPlease see the current list of [issues][FIXME] for ideas for contributing to this\nrepository. For making your contribution, we use the GitHub flow, which is\nnicely explained in the chapter [Contributing to a Project](http://git-scm.com/book/en/v2/GitHub-Contributing-to-a-Project) in Pro Git\nby Scott Chacon.\nLook for the tag ![good_first_issue](https://img.shields.io/badge/-good%20first%20issue-gold.svg). This indicates that the maintainers will welcome a pull request fixing this issue.  \n\n\n## Maintainer(s)\n\nCurrent maintainers of this lesson are \n\n* Geoffrey Woollard (@geoffwoollard)\n\n\n## Authors\n\nA list of contributors to the lesson can be found in [AUTHORS](AUTHORS)\n\n## Citation\n\nTo cite this lesson, please consult with [CITATION](CITATION)\n\n[lesson-example]: https://carpentries.github.io/lesson-example\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarpentries-incubator%2Fgpu-speedups","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarpentries-incubator%2Fgpu-speedups","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarpentries-incubator%2Fgpu-speedups/lists"}