Skip to main content
Ctrl+K
hawk hawk

Start here

  • Installation
  • Quickstart

Tutorials

  • Tutorials
    • Run your first kernel
    • Arguments and shapes
    • Stop when you’re done
    • One sample, one lane: .at, hawk.scatter and sample_index
    • Choosing a dispatch policy
    • Gradients, backward
    • Gradients, forward (and what autodiff refuses)
    • Gradients through branches and stops
    • Supply the derivatives your field already knows
    • Reverse a whole rollout: tapes and stop rules
    • Lookups, scatters and sums
    • Your own vocabulary
      • Describe your system once, write many kernels
      • Grow your vocabulary as your model grows
      • Capstone: your physics, end to end
    • Describe your system once, write many kernels
    • Grow your vocabulary as your model grows
    • Capstone: your physics, end to end

How-to guides

  • How-to guides
    • Every way to write and call a kernel
    • One Kind, two force models
    • When hawk can’t spell it
    • A drag kernel over a large ensemble
    • Checking a gradient against finite differences
    • Autodiff against torch
    • Hybrid orbit: analytic physics + a learned correction
    • Solve a small system in every lane
    • Run only the lanes you list
    • A kernel as standalone MISRA C

Domains

  • Domains
    • Orbits
    • Finite elements
    • Heat diffusion
    • Fluids
    • Solid mechanics
    • Molecular dynamics
    • Particle binning
    • Nuclear
    • Particle physics
    • Combustion
    • Biochemistry
    • Epidemiology
    • Energy
    • Finance
    • Control
    • Batched small matrices
    • Monte Carlo
    • Signal processing
    • Line of sight

Explanation

  • Explanation
    • Across lanes
    • How a kernel is compiled and run
    • Compiling
      • The compile cache
      • Compile options
    • Vocabulary and composition
    • Embedded C target
    • Interoperability
    • NVIDIA Warp: low-level control, side by side

Reference

  • API reference
    • hawk
    • hawk.math
      • hawk.math.nan
      • hawk.math.abs
      • hawk.math.abs2
      • hawk.math.absolute
      • hawk.math.acos
      • hawk.math.acosh
      • hawk.math.arg
      • 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.cho_solve
      • hawk.math.chol_from
      • hawk.math.cholesky
      • hawk.math.cmul
      • hawk.math.conj
      • hawk.math.cosh
      • hawk.math.cross
      • hawk.math.det
      • hawk.math.diag
      • hawk.math.diagonal
      • hawk.math.dispatch
      • hawk.math.dot
      • hawk.math.eigh
      • hawk.math.erf
      • hawk.math.erfc
      • hawk.math.eye
      • hawk.math.inv
      • hawk.math.lm_step
      • hawk.math.lstsq
      • hawk.math.lu
      • hawk.math.lu_solve
      • hawk.math.mat
      • hawk.math.mvn_sample
      • hawk.math.solve
      • hawk.math.trace
      • hawk.math.tril
      • 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.index
      • hawk.math.int32
      • 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.mean
      • hawk.math.min
      • hawk.math.minimum
      • hawk.math.n_samples
      • hawk.math.norm
      • hawk.math.outer
      • hawk.math.pair_index
      • 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.ray_aabb
      • hawk.math.ray_sphere
      • hawk.math.ray_tri
      • hawk.math.real
      • 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.spacing
      • hawk.math.split_index
      • hawk.math.sqrt
      • hawk.math.sum
      • hawk.math.take
      • hawk.math.tan
      • hawk.math.tanh
      • hawk.math.transpose
      • hawk.math.trunc
      • hawk.math.uint32
      • hawk.math.vec
      • hawk.math.vsum
      • hawk.math.where
    • hawk.geometry
      • hawk.geometry.PLANES
      • hawk.geometry.build_bvh
      • hawk.geometry.closest_hit
      • hawk.geometry.BVH
      • hawk.geometry.BVHTables
    • 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.IndexSet
      • hawk.ext.Kind
      • hawk.ext.Output
      • hawk.ext.PrimitiveDef
      • hawk.ext.KernelKind
    • hawk.diff
      • hawk.diff.vjp
      • hawk.diff.jvp
      • hawk.diff.tape
      • hawk.diff.step_vjp
      • hawk.diff.step_jvp
      • hawk.diff.refine_entry
      • hawk.diff.param_planes
      • hawk.diff.Derived
    • hawk.diff.event
      • hawk.diff.event.event_guard
      • hawk.diff.event.guard_kernel
      • hawk.diff.event.state_guard
      • hawk.diff.event.EventGuard
    • 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
    • hawk.embedded
      • hawk.embedded.check
      • hawk.embedded.export
      • hawk.embedded.finish_report
      • hawk.embedded.refuse_audit_hits
      • hawk.embedded.render
      • hawk.embedded.report_text
      • hawk.embedded.EmbeddedArtifact
      • hawk.embedded.EmbeddedProfile
      • hawk.embedded.EmbeddedSource
    • hawk.kernel
    • hawk.Kernel
    • hawk.raw_device
    • hawk.RawBlock
    • hawk.steps
    • hawk.scatter
    • hawk.lane_position
    • hawk.primitive
    • hawk.resolve_dispatch
    • hawk.samples_first
    • hawk.samples_last
    • hawk.Value
    • hawk.Quantity
    • hawk.Scalar
    • hawk.Index
    • hawk.Int32
    • hawk.UInt32
    • hawk.Quat
    • hawk.Vector
    • hawk.Matrix
    • hawk.Param
    • hawk.Mutable
    • hawk.Table
    • hawk.Grid
    • hawk.Sorted
    • hawk.Staged
    • hawk.Wide
    • hawk.WideOut
    • hawk.Terminated
    • hawk.HawkError
  • Broadcasting and the run-time first axis
  • Derivatives: step_jvp, step_vjp, jump= and loops
  • Small linear algebra, per lane
  • Emit form
  • Glossary

Contributing

  • Contributing
    • Add a native function end to end
    • Add a target

All modules for which code is available

  • hawk._core
  • hawk._plane_layout
  • hawk.artifact
    • hawk.artifact.bundle
    • hawk.artifact.layout
    • hawk.artifact.manifest
    • hawk.artifact.unit_cache
  • hawk.compile.cache
  • hawk.compile.drivers
  • hawk.compile.nvrtc
  • hawk.compile.payload
  • hawk.compile.toolchain
  • hawk.diff.event
  • hawk.diff.params
  • hawk.diff.tape
  • hawk.diff.transform
  • hawk.embedded
    • hawk.embedded.profile
  • hawk.ext
    • hawk.ext.primitive
  • hawk.geometry
  • hawk.ir.compound
  • hawk.ir.nodes
  • hawk.math
  • hawk.runtime
  • hawk.trace.decl
  • hawk.trace.kernel
  • hawk.trace.linalg
  • hawk.trace.raw
  • hawk.trace.rays
  • hawk.trace.reduce
  • hawk.trace.steps
  • hawk.trace.value

By Alessandro Masat

© Copyright 2026, Alessandro Masat.

part of RAPTOR