File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -158,22 +158,26 @@ endif()
158158find_package (Python REQUIRED COMPONENTS Interpreter Development.Module ${SKBUILD_SABI_COMPONENT} )
159159
160160add_custom_command (
161-   OUTPUT  "${CMAKE_BINARY_DIR} /cython_wrapper .cpp" 
161+   OUTPUT  "${CMAKE_BINARY_DIR} /tilelang_cython_wrapper .cpp" 
162162  COMMENT 
163163    "Cythoning tilelang/jit/adapter/cython/cython_wrapper.pyx" 
164164  COMMAND  Python::Interpreter -m cython
165165          "${CMAKE_CURRENT_SOURCE_DIR} /tilelang/jit/adapter/cython/cython_wrapper.pyx" 
166-           --cplus --output -file "${CMAKE_BINARY_DIR} /cython_wrapper.cpp" 
166+           --module-name  tilelang_cython_wrapper
167+           --cplus --output -file "${CMAKE_BINARY_DIR} /tilelang_cython_wrapper.cpp" 
167168  DEPENDS  "${CMAKE_CURRENT_SOURCE_DIR} /tilelang/jit/adapter/cython/cython_wrapper.pyx" 
168169  VERBATIM )
169170
170171if (NOT  "${SKBUILD_SABI_VERSION} "  STREQUAL  "" )
171172  set (USE_SABI USE_SABI ${SKBUILD_SABI_VERSION} )
172173endif ()
173174
174- python_add_library(cython_wrapper MODULE "${CMAKE_BINARY_DIR} /cython_wrapper.cpp"  ${USE_SABI}  WITH_SOABI)
175- # Install to site dir to support direct import 
176- install (TARGETS cython_wrapper LIBRARY DESTINATION  .)
175+ python_add_library(tilelang_cython_wrapper MODULE "${CMAKE_BINARY_DIR} /tilelang_cython_wrapper.cpp"  ${USE_SABI}  WITH_SOABI)
176+ # Install extension into the tilelang package directory 
177+ install (TARGETS tilelang_cython_wrapper
178+         LIBRARY DESTINATION  tilelang
179+         RUNTIME DESTINATION  tilelang
180+         ARCHIVE DESTINATION  tilelang)
177181
178182# let libtilelang to search tvm/tvm_runtime in same dir 
179183if (APPLE )
Original file line number Diff line number Diff line change 2020TVM_LIBRARY_NOT_FOUND_MESSAGE  =  ("TVM is not installed or found in the expected path" )
2121
2222TL_ROOT  =  os .path .dirname (os .path .abspath (__file__ ))
23- TL_LIBS  =  [os .path .join (i , 'lib' )  for   i   in  [ TL_ROOT ] ]
23+ TL_LIBS  =  [TL_ROOT ,  os .path .join (TL_ROOT , 'lib' )]
2424TL_LIBS  =  [i  for  i  in  TL_LIBS  if  os .path .exists (i )]
2525
2626DEV  =  False 
3737assert  TL_LIBS  and  all (
3838    os .path .exists (i ) for  i  in  TL_LIBS ), f'tilelang lib root do not exists: { TL_LIBS }  
3939
40+ for  lib  in  TL_LIBS :
41+     if  lib  not  in sys .path :
42+         sys .path .insert (0 , lib )
43+ 
4044
4145def  _find_cuda_home () ->  str :
4246    """Find the CUDA install path. 
Original file line number Diff line number Diff line change 2222logger  =  logging .getLogger (__name__ )
2323
2424try :
25-     # Load cython_wrapper.api3.so in env.py 
26-     from  cython_wrapper  import  CythonKernelWrapper 
25+     from  tilelang_cython_wrapper  import  CythonKernelWrapper 
2726except  ImportError :
28-     # TODO: tolerance a build without cython backend 
2927    raise 
3028
3129
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments