Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CPU backend #647

Merged
merged 20 commits into from
Jan 30, 2025
Merged

CPU backend #647

merged 20 commits into from
Jan 30, 2025

Conversation

wsmoses
Copy link
Member

@wsmoses wsmoses commented Jan 29, 2025

Naturally, requires jll update.

But enables us to run GPU kernels on CPU (without a cuda device)

@wsmoses wsmoses requested review from giordano and avik-pal January 29, 2025 00:34
@wsmoses
Copy link
Member Author

wsmoses commented Jan 29, 2025

cc @giordano

@giordano giordano mentioned this pull request Jan 29, 2025
Copy link
Member

@giordano giordano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds cool!

src/Compiler.jl Outdated
elseif backend == "CPU"
backend = "cpu"
end
@show backend
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover debug print?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or rather "curreently being debugged print" :P

src/Compiler.jl Show resolved Hide resolved
src/Compiler.jl Outdated Show resolved Hide resolved
@giordano
Copy link
Member

On macOS:

$ nm /Users/mose/.julia/artifacts/f3d3555e5fc223023219f21123197e90fa208f2d/lib/libReactantExtra.dylib | grep ClientGetPlatformName
000000000000472c t _ClientGetPlatformName

Lowercase t means that the symbol isn't visible (it's local, non-external).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@wsmoses
Copy link
Member Author

wsmoses commented Jan 29, 2025

@avik-pal was that fn not marked exported?

wsmoses and others added 2 commits January 29, 2025 23:29
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@giordano giordano mentioned this pull request Jan 30, 2025
Project.toml Outdated Show resolved Hide resolved
end
end

if device_ordinal < 0
device_ordinal = XLA.DeviceToClientDeviceOrdinal(device)
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change

Comment on lines 1031 to 1034
exec = XLA.Compile(
client,
mod;
device_ordinal,
num_replicas=1,
num_partitions=1,
use_shardy_partitioner=false,
mod
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
exec = XLA.Compile(
client,
mod;
device_ordinal,
num_replicas=1,
num_partitions=1,
use_shardy_partitioner=false,
mod
)
exec = XLA.Compile(client, mod)

Comment on lines 564 to 567
function Compile(
client::Client,
mod::MLIR.IR.Module;
device_ordinal::Int=-1,
num_replicas::Int=1,
num_partitions::Int=1,
use_shardy_partitioner::Bool=false,
mod::MLIR.IR.Module
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[JuliaFormatter] reported by reviewdog 🐶

Suggested change
function Compile(
client::Client,
mod::MLIR.IR.Module;
device_ordinal::Int=-1,
num_replicas::Int=1,
num_partitions::Int=1,
use_shardy_partitioner::Bool=false,
mod::MLIR.IR.Module
)
function Compile(client::Client, mod::MLIR.IR.Module)

@wsmoses wsmoses merged commit 1925f70 into main Jan 30, 2025
35 of 39 checks passed
@wsmoses wsmoses deleted the cpu branch January 30, 2025 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants