Page MenuHomePhabricator
Feed Advanced Search

Jul 31 2022

linjamaki added a comment to D130766: [SPIR-V] Disable opaque pointers in relese 15.

CC to @linjamaki in case there is anything else/different needed for HIP.

Jul 31 2022, 11:01 PM · Restricted Project

May 17 2022

linjamaki added a comment to D125679: [Clang] Added options for integrated backend only used for SPIR-V for now.

From my point of view this patch LGTM.

May 17 2022, 3:10 AM · Restricted Project, Restricted Project

May 9 2022

linjamaki abandoned D110685: [HIPSPV][4/4] Add option to use llc to emit SPIR-V.

Sounds good to me. I’ll make a new patch when there is a need for it and close this one.

May 9 2022, 1:47 AM · Restricted Project, Restricted Project
linjamaki added inline comments to D124776: [SPIR-V] Allow setting SPIR-V version via target triple.
May 9 2022, 1:46 AM · Restricted Project, Restricted Project

Feb 3 2022

linjamaki added a comment to D118876: [HIPSPV] Fix literals are mapped to Generic address space.

Thanks for the review, @yaxunl. Could you push this to the LLVM? And to the LLVM 14 release branch too, if possible?

Feb 3 2022, 11:46 PM · Restricted Project

Feb 2 2022

linjamaki published D118876: [HIPSPV] Fix literals are mapped to Generic address space for review.
Feb 2 2022, 11:57 PM · Restricted Project

Jan 26 2022

linjamaki added a comment to D117137: [Driver] Add CUDA support for --offload param.

Does that mean only "spirv{64}-unknown-unknown" is acceptable, or "spirv{64}-amd-unknown-unknown" is also acceptable?

Jan 26 2022, 2:42 AM · Restricted Project

Jan 25 2022

linjamaki added a comment to D117137: [Driver] Add CUDA support for --offload param.

SPIR-V target requires that the OS and the environment type is unknown (see TargetInfo::AllocateTarget and BaseSPIRTargetInfo). The clang would fail to create a SPIR-V target if there is an OS or environment component in the target string known by the Triple. This could lead to a misleading error message.

Jan 25 2022, 12:59 AM · Restricted Project

Dec 21 2021

linjamaki added a comment to D111047: CUDA/HIP: Allow __int128 on the host side.

This patch should be ready to land. @tra, could you please commit it to the LLVM for us? Thanks.

Dec 21 2021, 5:28 AM · Restricted Project
linjamaki updated the diff for D111047: CUDA/HIP: Allow __int128 on the host side.

Rebase.

Dec 21 2021, 4:35 AM · Restricted Project
linjamaki added a comment to D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Thanks, @yaxunl.

Dec 21 2021, 1:25 AM · Restricted Project

Dec 16 2021

linjamaki added a comment to D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Assuming that this patch is ready to land. @tra or @yaxunl, could you please commit this patch to the LLVM for us? Thanks.

Dec 16 2021, 11:41 PM · Restricted Project
linjamaki added a comment to D112410: [SPIR-V] Add a toolchain for SPIR-V in clang.

If I understand correctly, the default optimization level is -O2 for the OpenCL and OpenCL++ language mode (according to CompilerInvocation.cpp:getOptimizationLevel()). Since higher than -O0 may not work with the translator, should the SPIR-V tool chain override this default and set it to -O0 (unless a user passes some -O option)?

Dec 16 2021, 5:25 AM · Restricted Project
linjamaki updated the diff for D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Rebase.

Dec 16 2021, 1:49 AM · Restricted Project

Dec 14 2021

linjamaki added a comment to D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Thanks, @tra.

Dec 14 2021, 11:51 PM · Restricted Project
linjamaki added a comment to D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

This patch should be ready to land. @tra, could you please commit this to the LLVM for us. Thanks.

Dec 14 2021, 5:23 AM · Restricted Project
linjamaki updated the diff for D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Rebase.

Dec 14 2021, 4:28 AM · Restricted Project

Dec 13 2021

linjamaki added a comment to D110549: [HIPSPV][1/4] Refactor HIP tool chain.

Thanks, @yaxunl.

Dec 13 2021, 10:26 PM · Restricted Project
linjamaki abandoned D108367: [NFC] computeSPIRKernelABIInfo(): use SPIRABInfo.

D109818 includes the change in this patch.

Dec 13 2021, 6:01 AM · Restricted Project

Dec 10 2021

linjamaki added a comment to D110549: [HIPSPV][1/4] Refactor HIP tool chain.

Assuming this patch is ready to land. @yaxunl, Could you please commit this patch to the LLVM for us. Thanks.

Dec 10 2021, 6:53 AM · Restricted Project
linjamaki updated the diff for D110549: [HIPSPV][1/4] Refactor HIP tool chain.

Rebase.

Dec 10 2021, 6:13 AM · Restricted Project

Dec 8 2021

linjamaki added a comment to D109818: [HIPSPV] Convert HIP kernels to SPIR-V kernels.

Thanks, @bader.

Dec 8 2021, 10:46 PM · Restricted Project
linjamaki added a comment to D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Thanks for the feedback. The --offload is meant to support multiple targets but right now it is restricted to one at most. The limitation comes from the HIPActionBuilder and CudaActionBuilderBase which currently expects a single target triple and toolchain for all offload devices. To relax the --offload target count cap we would need to adjust the action builders to support multiple target triples and create a separate toolchain for each (unique) target triple.

Dec 8 2021, 1:12 AM · Restricted Project
linjamaki updated the diff for D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.
  • Add comments to clarify the limitation of the --offload option to one target.
Dec 8 2021, 1:09 AM · Restricted Project
linjamaki updated the diff for D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Rebase.

Dec 8 2021, 12:10 AM · Restricted Project
linjamaki updated the diff for D110549: [HIPSPV][1/4] Refactor HIP tool chain.

Rebase.

Dec 8 2021, 12:09 AM · Restricted Project
linjamaki added a comment to D109818: [HIPSPV] Convert HIP kernels to SPIR-V kernels.

Cherry-picking should work now, @bader.

Dec 8 2021, 12:07 AM · Restricted Project
linjamaki updated the diff for D109818: [HIPSPV] Convert HIP kernels to SPIR-V kernels.

Rebase.

Dec 8 2021, 12:03 AM · Restricted Project

Dec 3 2021

linjamaki added a comment to D109818: [HIPSPV] Convert HIP kernels to SPIR-V kernels.

The patch is ready to land. @Anastasia, @bader, could you commit this patch to the LLVM for us? Thanks.

Dec 3 2021, 4:17 AM · Restricted Project
linjamaki added a comment to D108621: [HIPSPV] Add CUDA->SPIR-V address space mapping.

Thanks, @Anastasia.

Dec 3 2021, 4:16 AM · Restricted Project, Restricted Project

Dec 1 2021

linjamaki added a comment to D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

@tra, gentle ping.

Dec 1 2021, 4:11 AM · Restricted Project
linjamaki added a comment to D108621: [HIPSPV] Add CUDA->SPIR-V address space mapping.

@Anastasia, Could you please commit this patch to the LLVM for us? Thanks.

Dec 1 2021, 4:10 AM · Restricted Project, Restricted Project

Nov 25 2021

linjamaki updated the diff for D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Disable debug info generation for device code.

Nov 25 2021, 2:26 AM · Restricted Project

Nov 24 2021

linjamaki added a comment to D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Could you please clarify the interface to SPIRV-LLVM-Translator tool, specifically:

  • Does clang lookup the path to the translator or assume any default path?
Nov 24 2021, 11:28 PM · Restricted Project

Nov 23 2021

linjamaki added a comment to D110549: [HIPSPV][1/4] Refactor HIP tool chain.

Thanks for the review.

Nov 23 2021, 1:32 AM · Restricted Project
linjamaki added a comment to D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Thanks for the review.

Nov 23 2021, 1:30 AM · Restricted Project
linjamaki updated the diff for D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Retry push changes.

Nov 23 2021, 1:28 AM · Restricted Project
linjamaki updated the diff for D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Update a driver test case.

Nov 23 2021, 1:17 AM · Restricted Project
linjamaki updated the diff for D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Combine options with append().

Nov 23 2021, 1:16 AM · Restricted Project

Nov 18 2021

linjamaki added a comment to D112404: [SPIR-V] Add translator tool.

Thanks for the help!

Nov 18 2021, 3:13 AM · Restricted Project
linjamaki added inline comments to D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.
Nov 18 2021, 3:12 AM · Restricted Project
linjamaki updated the diff for D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.
  • Adjust --offload description: reflect the current state.
  • Adjust enum range check in IsAMDGpuArch().
  • Make --offload and --offload-arch options mutually exclusive.
Nov 18 2021, 3:09 AM · Restricted Project

Nov 16 2021

linjamaki added a comment to D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Gentle ping.

Nov 16 2021, 11:44 PM · Restricted Project
linjamaki added a comment to D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Gentle ping.

Nov 16 2021, 11:42 PM · Restricted Project
linjamaki added a comment to D110549: [HIPSPV][1/4] Refactor HIP tool chain.

Ping?

Nov 16 2021, 11:39 PM · Restricted Project
linjamaki added a comment to D112404: [SPIR-V] Add translator tool.

Hi @Anastasia and @bader,

Nov 16 2021, 11:37 PM · Restricted Project
linjamaki updated the diff for D111047: CUDA/HIP: Allow __int128 on the host side.

Rebase.

Nov 16 2021, 12:12 AM · Restricted Project
linjamaki updated the diff for D110685: [HIPSPV][4/4] Add option to use llc to emit SPIR-V.

Rebase.

Nov 16 2021, 12:08 AM · Restricted Project, Restricted Project
linjamaki updated the diff for D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Rebase.

Nov 16 2021, 12:07 AM · Restricted Project
linjamaki updated the diff for D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Rebase.

Nov 16 2021, 12:07 AM · Restricted Project
linjamaki updated the diff for D110549: [HIPSPV][1/4] Refactor HIP tool chain.

Rebase.

Nov 16 2021, 12:05 AM · Restricted Project
linjamaki updated the diff for D109818: [HIPSPV] Convert HIP kernels to SPIR-V kernels.

Rebase.

Nov 16 2021, 12:04 AM · Restricted Project

Nov 15 2021

linjamaki added inline comments to D108621: [HIPSPV] Add CUDA->SPIR-V address space mapping.
Nov 15 2021, 11:14 PM · Restricted Project, Restricted Project
linjamaki updated the diff for D108621: [HIPSPV] Add CUDA->SPIR-V address space mapping.

Rebase, add asserts and move address space map reset for HIP from SPIRVTargetInfo to BaseSPIRTargetInfo

Nov 15 2021, 11:09 PM · Restricted Project, Restricted Project
linjamaki updated the diff for D112404: [SPIR-V] Add translator tool.

Rebase.

Nov 15 2021, 11:04 PM · Restricted Project

Nov 2 2021

linjamaki added a comment to D109144: [SPIR-V] Add SPIR-V triple architecture and clang target info.

Is this patch ready to land on the LLVM? We do not have commit rights, so can you please commit this patch for us? Thanks.

Nov 2 2021, 2:13 AM · Restricted Project, Restricted Project

Oct 28 2021

linjamaki updated the diff for D112410: [SPIR-V] Add a toolchain for SPIR-V in clang.

Rebase on updated llvm-spirv tool (D112404).

Oct 28 2021, 6:27 AM · Restricted Project
linjamaki added a comment to D112404: [SPIR-V] Add translator tool.

Thanks for the review.

Oct 28 2021, 5:45 AM · Restricted Project
linjamaki updated the diff for D112404: [SPIR-V] Add translator tool.

Rename SPIRV::Translator's tool names as suggested by bader.

Oct 28 2021, 5:40 AM · Restricted Project

Oct 27 2021

linjamaki updated the diff for D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Update for changes in D112404.

Oct 27 2021, 11:50 PM · Restricted Project
linjamaki updated the diff for D112404: [SPIR-V] Add translator tool.

Remove --spirv-ext and --spirv-max-version.

Oct 27 2021, 11:48 PM · Restricted Project
linjamaki added a comment to D112410: [SPIR-V] Add a toolchain for SPIR-V in clang.

Do I read it correctly that you would have no objections for others to rework this patch if needed? :)

Oct 27 2021, 11:44 PM · Restricted Project
linjamaki added inline comments to D112404: [SPIR-V] Add translator tool.
Oct 27 2021, 11:39 PM · Restricted Project

Oct 26 2021

linjamaki added reviewers for D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP: tra, rsmith.
Oct 26 2021, 3:07 AM · Restricted Project
linjamaki updated the diff for D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Improve --offload option description.

Oct 26 2021, 3:02 AM · Restricted Project
linjamaki added reviewers for D110618: [HIPSPV][2/4] Add HIPSPV tool chain: tra, rsmith.
Oct 26 2021, 2:11 AM · Restricted Project
linjamaki added a comment to D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Gentle ping. Is anything needed to be addressed to get this patch accepted?

Oct 26 2021, 2:11 AM · Restricted Project
linjamaki added reviewers for D110549: [HIPSPV][1/4] Refactor HIP tool chain: tra, rsmith.
Oct 26 2021, 2:09 AM · Restricted Project
linjamaki added a comment to D110549: [HIPSPV][1/4] Refactor HIP tool chain.

Gentle ping.

Oct 26 2021, 2:09 AM · Restricted Project
linjamaki added a comment to D108621: [HIPSPV] Add CUDA->SPIR-V address space mapping.

Gentle ping. Is anything needed to be addressed to get this patch accepted?

Oct 26 2021, 2:07 AM · Restricted Project, Restricted Project
linjamaki added a comment to D111047: CUDA/HIP: Allow __int128 on the host side.

Thanks for the review. Updated the patch with the style suggestions.

Oct 26 2021, 2:02 AM · Restricted Project
linjamaki updated the diff for D111047: CUDA/HIP: Allow __int128 on the host side.

Rephrase expressions.

Oct 26 2021, 1:56 AM · Restricted Project

Oct 25 2021

linjamaki updated subscribers of D112410: [SPIR-V] Add a toolchain for SPIR-V in clang.
Oct 25 2021, 12:25 AM · Restricted Project
linjamaki updated subscribers of D112410: [SPIR-V] Add a toolchain for SPIR-V in clang.
Oct 25 2021, 12:24 AM · Restricted Project
linjamaki published D112410: [SPIR-V] Add a toolchain for SPIR-V in clang for review.
Oct 25 2021, 12:23 AM · Restricted Project
linjamaki added reviewers for D112404: [SPIR-V] Add translator tool: Anastasia, bader.
Oct 25 2021, 12:11 AM · Restricted Project
linjamaki updated the diff for D111047: CUDA/HIP: Allow __int128 on the host side.

Rebase.

Oct 25 2021, 12:07 AM · Restricted Project
linjamaki updated the diff for D110685: [HIPSPV][4/4] Add option to use llc to emit SPIR-V.

Rebase.

Oct 25 2021, 12:06 AM · Restricted Project, Restricted Project
linjamaki updated the diff for D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Rebase.

Oct 25 2021, 12:05 AM · Restricted Project
linjamaki updated the diff for D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Rebase and use SPIRV::constructTranslateCommand() to contruct
the LLVM-SPIR-V translation command.

Oct 25 2021, 12:03 AM · Restricted Project

Oct 24 2021

linjamaki updated the diff for D110549: [HIPSPV][1/4] Refactor HIP tool chain.

Rebase.

Oct 24 2021, 11:59 PM · Restricted Project
linjamaki updated the diff for D109818: [HIPSPV] Convert HIP kernels to SPIR-V kernels.

Rebase.

Oct 24 2021, 11:57 PM · Restricted Project
linjamaki updated the diff for D108621: [HIPSPV] Add CUDA->SPIR-V address space mapping.

Rebase.

Oct 24 2021, 11:56 PM · Restricted Project, Restricted Project
linjamaki requested review of D112404: [SPIR-V] Add translator tool.
Oct 24 2021, 11:52 PM · Restricted Project
linjamaki updated the diff for D109144: [SPIR-V] Add SPIR-V triple architecture and clang target info.

Rebase.

Oct 24 2021, 11:50 PM · Restricted Project, Restricted Project

Oct 15 2021

linjamaki updated subscribers of D109144: [SPIR-V] Add SPIR-V triple architecture and clang target info.

Thanks for the clarifications. So it seems that you are not expecting that the device target triple is being explicitly passed anywhere then and that means you pass the device triple implicitly?

We are meaning to use the --offload as a way to pass device target triple explicitly.

Although your --offload option does seem conceptually like a device target triple, so I wonder if better naming for it would be --offload-target? Would it work for you if we introduce SPIR-V triple explicitly and you use it as a device offload triple?

To introduce a way to pass a device target triple in HIP compilation, we decided it to be aligned with the envisioned “Unified Offload Option” feature [1] to avoid overlap with similar concept. The design of the feature is pending. AFAIK, @yaxunl, who is working on it, hasn't got time yet to continue the work. In D110622 we propose adding the --offload option as partial implementation and there is a bit of discussion about the design too.

It would probably makes sense to use the same triple to targeting SPIR-V generation by everyone?

Yes, it makes sense.

However I appreciate that OpenCL flow would be somewhat different since it doesn't have a split into host and device but only contains device compilation phase...

The split is specific to offloading languages (such as CUDA, HIP and OpenMP) whose compilation flow is different from the traditional compilation flow. The traditional compilation flow used for non-offloading languages naturally does not have the host/device compilation split.

Oct 15 2021, 1:22 AM · Restricted Project, Restricted Project

Oct 13 2021

linjamaki added a comment to D109144: [SPIR-V] Add SPIR-V triple architecture and clang target info.

Can you explain what does this mean

It was trying to clarify a potential misunderstanding of how programs are compiled when HIPSPV is targeted: For HIPSPV, the SPIR-V code generation is done by the clang driver. When we compile HIP programs for HIPCL or the HIPLZ runtime, we issue a single clang command such as this:

clang++ --offload=spirv64 foo.hip -l<hip-runtime> -o foo

With this, the clang driver compiles the device side code to a SPIR-V binary and then compiles host side code, and embeds the SPIR-V binary to the host (fat) binary.

Oct 13 2021, 10:54 PM · Restricted Project, Restricted Project

Oct 8 2021

linjamaki added a comment to D109144: [SPIR-V] Add SPIR-V triple architecture and clang target info.

> What I have in mind is to continue using SPIR target for now (until SPIR-V back-end is added).

For instance, SYCL compiler emits code for SPIR target and code format is configured via flag.

-emit-llvm changes output file format for regular C++ compilation flow:

clang++ a.cpp -c -o a.o                      # object format by default 
clang++ a.cpp -c -emit-llvm -o a.bc          # LLVM IR format with `-emit-llvm`

Similar approach for HIP device compilation flow:

clang++ -target spir -x hip a.cpp -cuda-device-only -o a.spv                 # SPIR-V format by default
clang++ -target spir -x hip a.cpp -cuda-device-only -emit-llvm -o a.bc       # LLVM IR (aka SPIR) format with `-emit-llvm` if needed

I think this was proposed in RFC. @linjamaki, am I right?

Oct 8 2021, 6:16 AM · Restricted Project, Restricted Project

Oct 6 2021

linjamaki added a comment to D110685: [HIPSPV][4/4] Add option to use llc to emit SPIR-V.

Ok, is the idea to deprecate this flag once we switch to llc by default then?

Oct 6 2021, 5:23 AM · Restricted Project, Restricted Project

Oct 4 2021

linjamaki published D111047: CUDA/HIP: Allow __int128 on the host side for review.
Oct 4 2021, 3:51 AM · Restricted Project
linjamaki published D110685: [HIPSPV][4/4] Add option to use llc to emit SPIR-V for review.
Oct 4 2021, 3:22 AM · Restricted Project, Restricted Project
linjamaki updated the diff for D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

Repurpose 'Generic' CudaArch, Use getAllArgValues() for reading
--offload values and fix a enum range.

Oct 4 2021, 2:32 AM · Restricted Project
linjamaki updated the diff for D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Update option description.

Oct 4 2021, 1:52 AM · Restricted Project
linjamaki added a comment to D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP.

A Cuda GPU architecture ‘generic’ is added. The name is picked from the LLVM SPIR-V Backend. In the HIPSPV code path the architecture name is inserted to the bundle entry ID as target ID. Target ID is expected to be always present so a component in the target triple is not mistaken as target ID.

How generic is 'generic'? If I understand the statement above correctly, it should probably reflect that it's specific to spir-v.
If it's the only possible spir-v variant, then calling it`spir-v` might be more meaningful.
If we expect to see other spir-v variants in the future it would allow us to clearly differentiate between them later.
E.g. --offload=spirv-a,spirv-b. It would be rather odd if we had to use --offload=generic, spirv-b.

Oct 4 2021, 1:24 AM · Restricted Project
linjamaki added a comment to D110618: [HIPSPV][2/4] Add HIPSPV tool chain.

Considering that SPIR-V translation step is also required for other languages would it make sense to add llvm-spirv as a common tool like for example C/C++ linkers and create a bit of common infrastructure? It might be something we can do as a separate step too but it would be good to make sure nothing prevents us from doing this in the future... We should probably also think about the command line interface unification as it probably doesn't make sense for every language to add their own flags for locating SPIR-V translator.

I don’t think it would work out well. llvm-spirv (or other tool relying on LLVM bitcode input) and LLVM may have version differences that cause obscure error cases - like newer LLVM producing bitcode with new features the tools are not expecting and ready for them. The usage of llvm-spirv tool in the HIPSPV tool chain is not intended to be a longer term solution due to this shortcoming.

Oct 4 2021, 1:11 AM · Restricted Project

Sep 29 2021

linjamaki published D110622: [HIPSPV][3/4] Enable SPIR-V emission for HIP for review.
Sep 29 2021, 1:15 AM · Restricted Project

Sep 28 2021

linjamaki updated subscribers of D110618: [HIPSPV][2/4] Add HIPSPV tool chain.
Sep 28 2021, 5:21 AM · Restricted Project
linjamaki added a reviewer for D110618: [HIPSPV][2/4] Add HIPSPV tool chain: yaxunl.
Sep 28 2021, 5:20 AM · Restricted Project
linjamaki published D110618: [HIPSPV][2/4] Add HIPSPV tool chain for review.
Sep 28 2021, 5:20 AM · Restricted Project
linjamaki published D110549: [HIPSPV][1/4] Refactor HIP tool chain for review.
Sep 28 2021, 1:29 AM · Restricted Project