# Is it time to migrate to CUDA.jl?

**URL:** <https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203>\
**Category:** GPU\
**Created:** [August 3, 2020, 4:38pm UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203 "2020-08-03T16:38:45Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dfdx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfdx/32/120_2.png) [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Post date:** [August 3, 2020, 4:38pm UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/1 "2020-08-03T16:38:45Z")

</div>

From documentation of corresponding packages:

- CuArrays are deprecated in favor of CUDA.jl
- CUDA.jl only works on Julia 1.4
- latest LTS version of Julia is 1.0

From these facts I conclude that the only way to keep backward compatibility is to _not_ migrate to CUDA.jl and keep using deprecated packages. Is this conclusion correct or I’m missing some workaround?

---

<div class="post-metadata">

**Author:** ![RocketRoss](https://avatars.discourse-cdn.com/v4/letter/r/bc8723/32.png) [@RocketRoss](https://discourse.julialang.org/u/RocketRoss)\
**Post date:** [August 15, 2020, 9:28am UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/2 "2020-08-15T09:28:56Z")

</div>

The JuliaCon State of Julia mentioned that Julia v1.0 is feeling very outdated, and that 1.6 will be the next LTS.

That’s my 5 cents (more like 1 cent).

---

<div class="post-metadata">

**Author:** ![dfdx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfdx/32/120_2.png) [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Post date:** [August 15, 2020, 11:10pm UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/3 "2020-08-15T23:10:33Z")

</div>

Strictly speaking, new LTS version doesn’t mean immediate migration to it, at least not in industry. For example, [Ansible](https://www.ansible.com/) added support for Python 3 only in 2018, 10 years after Python 3.0 was released. Latest version of [Spark](https://spark.apache.org/) still supports Java 8 (latest LTS is Java 11, latest overall is Java 14) and Python 2.7 (latest is 3.8). I’m working on 1-year-old Linux Mint based on 2-year-old Ubuntu version. Julia 1.0, released on August 8, 2018 doesn’t seem that old 🙂

Yet, given that Julia and [my package](https://github.com/dfdx/Yota.jl) don’t have that many users (yet), I decided to drop support for Julia \< 1.4 and migrate to CUDA.jl.

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [August 18, 2020, 6:59am UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/4 "2020-08-18T06:59:43Z")

</div>

Since CUDA.jl integrates tightly with the base Julia (its compiler, but also redefining internal functions to make array operations GPU compatible), it’s not that easy to maintain compatibility with older versions of Julia. 1.3 might still be possible, but beyond that we don’t have artifacts. I guess we could conditionalize all that code, but unless there’s a specific need that only makes the code more messy.

---

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [August 18, 2020, 10:20am UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/5 "2020-08-18T10:20:01Z")

</div>

Then, what’s the best CUDA.jl alternative working on Julia v1.5?

---

<div class="post-metadata">

**Author:** ![dfdx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfdx/32/120_2.png) [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Post date:** [August 18, 2020, 11:45am UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/6 "2020-08-18T11:45:00Z")

</div>

Thanks for clarification! I actually enjoy both - progress in CUDA programming and the way the team treats breaking changes, i.e. decision to keep CuArrays & co. for older versions of Julia and make a new package for the newer versions. The only piece I was missing is the intended way to switch. Hopefully, this post will help others realize how to do it 🙂

---

<div class="post-metadata">

**Author:** ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)\
**Post date:** [August 18, 2020, 4:22pm UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/7 "2020-08-18T16:22:05Z")

</div>

Current CUDA.jl should work with Julia 1.4+ (just tested some basic operations on 1.5/CUDA 11 the other day).

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [August 18, 2020, 6:47pm UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/8 "2020-08-18T18:47:48Z")

</div>

With [https://github.com/JuliaGPU/CUDA.jl/pull/377](https://github.com/JuliaGPU/CUDA.jl/pull/377) the next version will support 1.3+, but for the versions after that we’ll need to aggressively move forward (first 1.5+, then 1.6 or higher once it’s released) due to significant changes in Julia that do not provide backwards compatibility (mostly internal compiler APIs).

---

<div class="post-metadata">

**Author:** ![dfdx](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dfdx/32/120_2.png) [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Post date:** [August 18, 2020, 10:09pm UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/9 "2020-08-18T22:09:41Z")

</div>

In this scenario, what would be the best way to support several versions of Julia in a package that has CUDA.jl in its dependencies? Is there a way to conditionally specify different versions of CUDA.jl in Project.toml?

---

<div class="post-metadata">

**Author:** ![Yifan\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/4da419/32.png) [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Post date:** [August 19, 2020, 12:00am UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/10 "2020-08-19T00:00:45Z")

</div>

Are there any plans of supporting GPU data frames like this one: [https://github.com/rapidsai/cudf](https://github.com/rapidsai/cudf)

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [August 19, 2020, 6:01am UTC](https://discourse.julialang.org/t/is-it-time-to-migrate-to-cuda-jl/44203/11 "2020-08-19T06:01:10Z")

</div>

> [@dfdx](#):
>
> Is there a way to conditionally specify different versions of CUDA.jl in Project.toml?

Just list all of the major (i.e. breaking) versions that your package is compatible with, so currently `CUDA = "0.1, 1"`. The package resolver should pick a version that’s compatible with the user’s Julia.
