Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ public interface GraphExecutionContext : ExecutionContext, TrainingExecutionCont
public val tapeStack: TapeStack

/**
* Whether operations should be recorded
* Whether operations should be recorded. Overrides [ExecutionContext.isRecording] so modules
* can route eager-vs-trace without depending on the graph module.
*/
public val isRecording: Boolean get() = currentTape?.isRecording == true
override val isRecording: Boolean get() = currentTape?.isRecording == true


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ public interface ExecutionContext {
public val phase: Phase
public val inTraining: Boolean get() = phase == Phase.TRAIN

/**
* Whether this context is currently *recording* a trace/graph (vs. plain eager execution).
* Defaults to `false` (eager); the graph/tape context overrides it. Modules with an eager
* fast-path that bypasses `ops.*` (e.g. RoPE's raw-array interleaved rotation) can check this
* to emit a graph-traceable `ctx.ops.*` path instead when recording, so they export to
* StableHLO while keeping the fast path for eager inference.
*/
public val isRecording: Boolean get() = false

public val tensorDataFactory: TensorDataFactory

/**
Expand Down
Loading