Skip to main content
Ctrl+K
hawk hawk

Start here

  • Installation

Tutorials

  • Tutorials
    • Run your first kernel
    • Arguments and shapes
    • Stop when you’re done
    • Gradients, backward
    • Gradients, forward (and what autodiff refuses)
    • Lookups, scatters and sums
    • Gradients through branches and stops

Vocabulary

  • Vocabulary
    • Writing a vocabulary I: a family of kernels
    • Writing a vocabulary II: extend it by inheritance
    • Your own function, your own derivative
    • Capstone: your physics, end to end
    • When hawk can’t spell it

How-to guides

  • Examples
    • Example: a drag kernel over a large ensemble
    • Example: checking a gradient against finite differences
    • Example: one Kind, two force models
    • Example: hawk next to NVIDIA Warp

Explanation

  • The compile cache
  • Compile options
  • Interoperability

Reference

  • API reference
    • hawk
    • hawk.math
      • hawk.math.abs
      • hawk.math.absolute
      • hawk.math.acos
      • hawk.math.acosh
      • hawk.math.argmax
      • hawk.math.as_pure
      • hawk.math.as_vec3
      • hawk.math.asin
      • hawk.math.asinh
      • hawk.math.atan
      • hawk.math.atan2
      • hawk.math.atanh
      • hawk.math.cbrt
      • hawk.math.ceil
      • hawk.math.clip
      • hawk.math.copysign
      • hawk.math.cos
      • hawk.math.cosh
      • hawk.math.cross
      • hawk.math.dispatch
      • hawk.math.dot
      • hawk.math.erf
      • hawk.math.erfc
      • hawk.math.exp
      • hawk.math.exp2
      • hawk.math.expm1
      • hawk.math.fdim
      • hawk.math.floor
      • hawk.math.fma
      • hawk.math.fmod
      • hawk.math.hypot
      • hawk.math.isfinite
      • hawk.math.isinf
      • hawk.math.isnan
      • hawk.math.land
      • hawk.math.lnot
      • hawk.math.log
      • hawk.math.log10
      • hawk.math.log1p
      • hawk.math.log2
      • hawk.math.lor
      • hawk.math.max
      • hawk.math.maximum
      • hawk.math.min
      • hawk.math.minimum
      • hawk.math.n_samples
      • hawk.math.norm
      • hawk.math.outer
      • hawk.math.pow
      • hawk.math.power
      • hawk.math.quat_conj
      • hawk.math.quat_mul
      • hawk.math.quat_recip
      • hawk.math.quat_rotate
      • hawk.math.random_bernoulli
      • hawk.math.random_exponential
      • hawk.math.random_lognormal
      • hawk.math.random_multivariate_normal
      • hawk.math.random_normal
      • hawk.math.random_poisson1
      • hawk.math.random_uniform
      • hawk.math.random_uniform_int
      • hawk.math.remainder
      • hawk.math.rint
      • hawk.math.round
      • hawk.math.rsqrt
      • hawk.math.sample_index
      • hawk.math.select
      • hawk.math.sign
      • hawk.math.sin
      • hawk.math.sinh
      • hawk.math.split_index
      • hawk.math.sqrt
      • hawk.math.take
      • hawk.math.tan
      • hawk.math.tanh
      • hawk.math.transpose
      • hawk.math.trunc
      • hawk.math.vec
      • hawk.math.vsum
      • hawk.math.where
    • hawk.ext
      • hawk.ext.PLAIN
      • hawk.ext.ATOMIC
      • hawk.ext.DEFAULT_GUARD
      • hawk.ext.DEFAULT_KIND
      • hawk.ext.sink_policy
      • hawk.ext.compensated
      • hawk.ext.primitive
      • hawk.ext.primitives
      • hawk.ext.Guard
      • hawk.ext.Kind
      • hawk.ext.Output
      • hawk.ext.PrimitiveDef
      • hawk.ext.KernelKind
    • hawk.diff
      • hawk.diff.vjp
      • hawk.diff.jvp
      • hawk.diff.Derived
    • hawk.compile
      • hawk.compile.aether_include
      • hawk.compile.cache_stats
      • hawk.compile.compile_source
      • hawk.compile.compiler_identity
      • hawk.compile.cubin
      • hawk.compile.cubin_available
      • hawk.compile.current_payload
      • hawk.compile.default_cache_dir
      • hawk.compile.device
      • hawk.compile.device_compiler
      • hawk.compile.device_compiler_kind
      • hawk.compile.digest_file
      • hawk.compile.eagle_include
      • hawk.compile.host_codegen_flags
      • hawk.compile.host_compiler
      • hawk.compile.host_flags
      • hawk.compile.host_profile
      • hawk.compile.lookup_key
      • hawk.compile.opt_level
      • hawk.compile.publish
      • hawk.compile.reset_cache_stats
      • hawk.compile.Cache
      • hawk.compile.CompileOptions
      • hawk.compile.DeviceImage
    • hawk.runtime
      • hawk.runtime.DEVICE_CPU
      • hawk.runtime.descriptor_for_sidecar
      • hawk.runtime.kind_for
      • hawk.runtime.load
      • hawk.runtime.run
      • hawk.runtime.ArgBlock
      • hawk.runtime.HostKernel
    • hawk.artifact
      • hawk.artifact.arch
      • hawk.artifact.build
      • hawk.artifact.build_bundle
      • hawk.artifact.exports
      • hawk.artifact.plan_view
      • hawk.artifact.plugins
      • hawk.artifact.reset_unit_memo
      • hawk.artifact.unit_stats
      • hawk.artifact.write_manifest
      • hawk.artifact.Artifact
      • hawk.artifact.Bundle
      • hawk.artifact.Entry

Contributing

  • Contributing
    • Add a native function end to end
  • .md

Examples

Examples#

Standalone notebooks, each one task. Unlike the tutorials, these do not build on each other — start wherever the task matches what you need.

  • Example: a drag kernel over a large ensemble
  • Example: checking a gradient against finite differences
  • Example: one Kind, two force models
  • Example: hawk next to NVIDIA Warp

previous

When hawk can’t spell it

next

Example: a drag kernel over a large ensemble

By Alessandro Masat

© Copyright 2026, Alessandro Masat.

part of RAPTOR