Opake
======

Copyright 2025 Opake Authors

Licensed under the Apache License, Version 2.0 (the "License"); see
LICENSE in this directory for the full text.

This package includes software developed by third parties whose
licenses and copyright notices are reproduced below. Per-file SPDX and
copyright headers in the relevant source files identify which third
party each file derives from.


------------------------------------------------------------------------
Liger Kernel (BSD-2-Clause)
------------------------------------------------------------------------

The following files contain Triton kernels substantially derived from the
Liger Kernel project (https://github.com/linkedin/Liger-Kernel),
Copyright 2024 LinkedIn Corporation, distributed under the BSD 2-Clause
License. They carry an SPDX-License-Identifier of
"Apache-2.0 AND BSD-2-Clause" and the LinkedIn copyright line in their
file headers.

  opake/api/patches/kernels/rms_norm.py
  opake/api/patches/kernels/fused_add_rms_norm.py

BSD 2-Clause License text:

    Copyright 2024 LinkedIn Corporation
    All Rights Reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:

    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.
    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in
       the documentation and/or other materials provided with the
       distribution.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
    FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
    COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
    BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
    CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
    LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
    ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGE.


------------------------------------------------------------------------
Unsloth (Apache-2.0)
------------------------------------------------------------------------

The following files contain Triton kernels derived from the Unsloth
project (https://github.com/unslothai/unsloth), distributed under the
Apache License, Version 2.0. Adapted to Opake's vmap-friendly
new-style autograd dispatch (Opake_* + _Backward + setup_context).

  opake/api/patches/kernels/_utils.py
  opake/api/patches/kernels/swiglu.py
  opake/api/patches/kernels/geglu.py
  opake/api/patches/kernels/rope_embedding.py
  opake/api/patches/kernels/cross_entropy.py
  opake/api/patches/kernels/lora.py


------------------------------------------------------------------------
Apple cut_cross_entropy (Apache-2.0)
------------------------------------------------------------------------

The following file contains Triton kernels derived from Apple's
cut_cross_entropy project
(https://github.com/apple/ml-cross-entropy, ICLR 2025), distributed
under the Apache License, Version 2.0. Simplified to drop bias /
Kahan / VocabOrdering / dLSE / shift handling and adapted to Opake's
vmap-friendly autograd dispatch.

  opake/api/patches/kernels/_utils.py
  opake/api/patches/kernels/linear_cross_entropy.py
