[PATCH] D141736: [NVPTX] Use 'sm_60' architecture when expanding %ptxas-verify macro.

Pavel Kopyl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 15 15:35:26 PST 2023


pavelkopyl added inline comments.


================
Comment at: llvm/test/lit.cfg.py:239
     tools.extend([ToolSubst('%ptxas', ptxas_executable),
-                  ToolSubst('%ptxas-verify', '{} -c -o /dev/null -'.format(
+                  ToolSubst('%ptxas-verify', '{} -arch=sm_60 -c -o /dev/null -'.format(
                       ptxas_executable))])
----------------
tra wrote:
> pavelkopyl wrote:
> > tra wrote:
> > > This will be a problem for cases where we generate PTX for a newer GPU variants. 
> > > At the very least users need to be able to override `-arch=...` passed to ptxas-verify.
> > > 
> > > 
> > > 
> > I agree, but I guess overriding shouldn't be a problem. For example,
> > 
> > ```
> > %{ llc < %s -march=nvptx63 -mcpu=sm_80 | %ptxas-verify -arch=sm_80 %}
> > ```
> > 
> > gets expanded into:
> >  
> > ```
> > ... | /usr/local/cuda-12/bin/ptxas -arch=sm_60 -c - -arch=sm_80
> > ```
> > 
> > Ptxas warns on that:
> > 
> > "ptxas warning : incompatible redefinition for option 'gpu-name', the last value of this option was used".
> > 
> > So, the last 
> > ```
> > -arch=...
> > ``` 
> > 
> > option has a precedence over the previous ones. This is what we need. The warning message is dropped by /dev/null. 
> > 
> It may be a good idea to update lit docs and document that the default for #ptxas/%ptxas-verify is sm_60 now.
I'd like to document this, but it's not clear where to put comments exactly. I added them to llvm/test/lit.cfg.py. Is that OK?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141736/new/

https://reviews.llvm.org/D141736



More information about the llvm-commits mailing list