1. 19 Mar, 2025 1 commit
    • alex_xiao's avatar
      [Feature] Add database storage for JITKernel cache with Cython and Ctypes adapters (#213) · e789808b
      alex_xiao authored
      
      
      * [Dev] Add database mechanism to cache
      
      * [Dev] Fix database cache and test for it
      
      * [Dev] Refactor env.py to use TILELANG_CACHE_DIR and remove extra comment.
      
      * [Refactor] Improve code formatting and readability in multiple files
      
      * [Enhancement] Add execution backend options and improve kernel adapter initialization
      
      * [Refactor] Rename cached function to cached_kernel and update related references
      
      * [Enhancement] Enable target and target_host parameters in kernel loading and improve gemm test case
      
      * [Enhancement] Update kernel compilation to specify execution backend as "cython"
      
      * [Refactor] Rename cached_kernel to cached and update references in the codebase
      
      * [Enhancement] Un-comment and add test cases for matrix multiplication correctness; improve kernel caching logic and remove redundant code
      
      * [Refactor] Clean up code formatting and improve readability in cache and adapter modules
      
      * [Refactor] Remove unused imports
      
      * [Refactor] Update cached function signature to use PrimFunc and Optional types for improved type safety
      
      * [Refactor] Update cached function calls to use PrimFunc and improve parameter handling
      
      * [Refactor] Clean up import statements and improve code formatting in cache and kernel test files
      
      * Update tilelang/jit/kernel.py
      
      ---------
      Co-authored-by: default avatarLei Wang <34334180+LeiWang1999@users.noreply.github.com>
      e789808b
  2. 09 Mar, 2025 1 commit
    • Lei Wang's avatar
      [Feat] Introduce new caching mechanism for compiled kernels (#176) · 7bde63d5
      Lei Wang authored
      * Add kernel caching mechanism to TileLang
      
      - Implement a new `cached` function in `tilelang/cache/__init__.py` to cache and reuse compiled kernels
      - Expose the `cached` function in the main `tilelang/__init__.py`
      - Add a test case for cached matrix multiplication in `testing/python/cache/test_tilelang_cache_matmul.py`
      - Provide a `clear_cache()` function to reset the kernel cache when needed
      
      * Refactor kernel caching test and implementation
      
      - Simplify the `cached` function in `tilelang/cache/__init__.py`
      - Update test script `test_tilelang_cache_matmul.py` to use `tilelang.testing.main()`
      - Remove unnecessary whitespace and improve code formatting
      
      * Update import for `cached` function in MHA examples
      
      - Modify import statement in `example_mha_bwd.py` and `test_tilelang_kernel_mha_bwd.py`
      - Change import from `tilelang.profiler import cached` to `tilelang import cached`
      - Align with recent refactoring of kernel caching mechanism
      
      * Refactor `cached` function signature in kernel caching
      
      - Update function signature to use keyword-only arguments for `target` and `target_host`
      - Improve parameter order and readability of the `cached` decorator
      - Maintain existing functionality while enhancing function definition
      7bde63d5