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 @@ -18,6 +18,7 @@ public final class sk/ainet/context/DirectCpuExecutionContext : sk/ainet/context
public fun getInTraining ()Z
public fun getMemoryInfo ()Lsk/ainet/context/MemoryInfo;
public fun getMemoryPlanner ()Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public fun getMemoryScope ()Lsk/ainet/lang/memory/Scope;
public fun getMemoryTracker ()Lsk/ainet/lang/tensor/storage/MemoryTracker;
public fun getObservers ()Lsk/ainet/context/ExecutionObserverRegistry;
public fun getOps ()Lsk/ainet/lang/tensor/ops/TensorOps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ public final class sk/ainet/lang/graph/DefaultGraphExecutionContext : sk/ainet/l
public fun getInTraining ()Z
public fun getMemoryInfo ()Lsk/ainet/context/MemoryInfo;
public fun getMemoryPlanner ()Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public fun getMemoryScope ()Lsk/ainet/lang/memory/Scope;
public fun getMemoryTracker ()Lsk/ainet/lang/tensor/storage/MemoryTracker;
public fun getObservers ()Lsk/ainet/context/ExecutionObserverRegistry;
public fun getOps ()Lsk/ainet/lang/tensor/ops/KspTensorOps;
Expand Down Expand Up @@ -449,6 +450,7 @@ public final class sk/ainet/lang/graph/exec/GraphExecutionContext$DefaultImpls {
public static fun getHooks (Lsk/ainet/lang/graph/exec/GraphExecutionContext;)Lsk/ainet/lang/nn/hooks/ForwardHooks;
public static fun getInTraining (Lsk/ainet/lang/graph/exec/GraphExecutionContext;)Z
public static fun getMemoryPlanner (Lsk/ainet/lang/graph/exec/GraphExecutionContext;)Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public static fun getMemoryScope (Lsk/ainet/lang/graph/exec/GraphExecutionContext;)Lsk/ainet/lang/memory/Scope;
public static fun getMemoryTracker (Lsk/ainet/lang/graph/exec/GraphExecutionContext;)Lsk/ainet/lang/tensor/storage/MemoryTracker;
public static fun getScratch (Lsk/ainet/lang/graph/exec/GraphExecutionContext;)Lsk/ainet/lang/tensor/scratch/ScratchPool;
public static fun getTraceSink (Lsk/ainet/lang/graph/exec/GraphExecutionContext;)Lsk/ainet/lang/memory/trace/TraceSink;
Expand Down
71 changes: 71 additions & 0 deletions skainet-lang/skainet-lang-core/api/jvm/skainet-lang-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public final class sk/ainet/context/DefaultDataExecutionContext : sk/ainet/conte
public fun getInTraining ()Z
public fun getMemoryInfo ()Lsk/ainet/context/MemoryInfo;
public fun getMemoryPlanner ()Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public fun getMemoryScope ()Lsk/ainet/lang/memory/Scope;
public fun getMemoryTracker ()Lsk/ainet/lang/tensor/storage/MemoryTracker;
public fun getObservers ()Lsk/ainet/context/ExecutionObserverRegistry;
public fun getOps ()Lsk/ainet/lang/tensor/ops/TensorOps;
Expand Down Expand Up @@ -234,6 +235,7 @@ public abstract interface class sk/ainet/context/ExecutionContext {
public fun getInTraining ()Z
public abstract fun getMemoryInfo ()Lsk/ainet/context/MemoryInfo;
public fun getMemoryPlanner ()Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public fun getMemoryScope ()Lsk/ainet/lang/memory/Scope;
public fun getMemoryTracker ()Lsk/ainet/lang/tensor/storage/MemoryTracker;
public abstract fun getObservers ()Lsk/ainet/context/ExecutionObserverRegistry;
public abstract fun getOps ()Lsk/ainet/lang/tensor/ops/TensorOps;
Expand Down Expand Up @@ -261,6 +263,7 @@ public final class sk/ainet/context/ExecutionContext$DefaultImpls {
public static fun getHooks (Lsk/ainet/context/ExecutionContext;)Lsk/ainet/lang/nn/hooks/ForwardHooks;
public static fun getInTraining (Lsk/ainet/context/ExecutionContext;)Z
public static fun getMemoryPlanner (Lsk/ainet/context/ExecutionContext;)Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public static fun getMemoryScope (Lsk/ainet/context/ExecutionContext;)Lsk/ainet/lang/memory/Scope;
public static fun getMemoryTracker (Lsk/ainet/context/ExecutionContext;)Lsk/ainet/lang/tensor/storage/MemoryTracker;
public static fun getScratch (Lsk/ainet/context/ExecutionContext;)Lsk/ainet/lang/tensor/scratch/ScratchPool;
public static fun getTraceSink (Lsk/ainet/context/ExecutionContext;)Lsk/ainet/lang/memory/trace/TraceSink;
Expand Down Expand Up @@ -362,6 +365,7 @@ public final class sk/ainet/context/PhaseOverridingExecutionContext : sk/ainet/c
public fun getInTraining ()Z
public fun getMemoryInfo ()Lsk/ainet/context/MemoryInfo;
public fun getMemoryPlanner ()Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public fun getMemoryScope ()Lsk/ainet/lang/memory/Scope;
public fun getMemoryTracker ()Lsk/ainet/lang/tensor/storage/MemoryTracker;
public fun getObservers ()Lsk/ainet/context/ExecutionObserverRegistry;
public fun getOps ()Lsk/ainet/lang/tensor/ops/TensorOps;
Expand Down Expand Up @@ -411,6 +415,7 @@ public final class sk/ainet/context/TrainingExecutionContext$DefaultImpls {
public static fun getHooks (Lsk/ainet/context/TrainingExecutionContext;)Lsk/ainet/lang/nn/hooks/ForwardHooks;
public static fun getInTraining (Lsk/ainet/context/TrainingExecutionContext;)Z
public static fun getMemoryPlanner (Lsk/ainet/context/TrainingExecutionContext;)Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public static fun getMemoryScope (Lsk/ainet/context/TrainingExecutionContext;)Lsk/ainet/lang/memory/Scope;
public static fun getMemoryTracker (Lsk/ainet/context/TrainingExecutionContext;)Lsk/ainet/lang/tensor/storage/MemoryTracker;
public static fun getScratch (Lsk/ainet/context/TrainingExecutionContext;)Lsk/ainet/lang/tensor/scratch/ScratchPool;
public static fun getTraceSink (Lsk/ainet/context/TrainingExecutionContext;)Lsk/ainet/lang/memory/trace/TraceSink;
Expand Down Expand Up @@ -725,6 +730,27 @@ public final class sk/ainet/lang/memory/FormatKt {
public static final fun getFormatOrNull (Lsk/ainet/lang/tensor/Tensor;)Lsk/ainet/lang/memory/Format;
}

public final class sk/ainet/lang/memory/ForwardScope : sk/ainet/lang/memory/Scope {
public fun <init> (ILsk/ainet/lang/memory/trace/TraceSink;Ljava/lang/String;)V
public synthetic fun <init> (ILsk/ainet/lang/memory/trace/TraceSink;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun allocate (JLsk/ainet/lang/tensor/storage/MemoryDomain;Lsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage;
public fun allocateFloats (ILsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage$Heap;
public fun close ()V
public fun getKind ()Lsk/ainet/lang/memory/ScopeKind;
public fun getLiveBytes ()J
public final fun getName ()Ljava/lang/String;
public final fun getOverflowBytes ()J
public final fun getPeakFloats ()I
public fun getSink ()Lsk/ainet/lang/memory/trace/TraceSink;
public final fun getSlabFloats ()I
public final fun getSteps ()J
public final fun getUsedFloats ()I
public final fun isClosed ()Z
public final fun reset ()V
public final fun retain (Lsk/ainet/lang/memory/Storage$Heap;Lsk/ainet/lang/memory/Scope;Lsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage$Heap;
public static synthetic fun retain$default (Lsk/ainet/lang/memory/ForwardScope;Lsk/ainet/lang/memory/Storage$Heap;Lsk/ainet/lang/memory/Scope;Lsk/ainet/lang/tensor/TensorId;ILjava/lang/Object;)Lsk/ainet/lang/memory/Storage$Heap;
}

public final class sk/ainet/lang/memory/MappedBufferStorage : sk/ainet/lang/memory/Storage$Mapped {
public static final field Companion Lsk/ainet/lang/memory/MappedBufferStorage$Companion;
public synthetic fun <init> (JLjava/nio/file/Path;JLjava/nio/ByteBuffer;Lsk/ainet/lang/memory/Owner;Lsk/ainet/lang/tensor/TensorId;Lsk/ainet/lang/memory/trace/TraceSink;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
Expand Down Expand Up @@ -766,6 +792,24 @@ public final class sk/ainet/lang/memory/MappedFileStorage$Companion {
public static synthetic fun map$default (Lsk/ainet/lang/memory/MappedFileStorage$Companion;Ljava/nio/file/Path;JJLsk/ainet/lang/memory/ScopeKind;Lsk/ainet/lang/tensor/TensorId;Lsk/ainet/lang/memory/trace/TraceSink;ILjava/lang/Object;)Lsk/ainet/lang/memory/MappedFileStorage;
}

public final class sk/ainet/lang/memory/ModelScope : sk/ainet/lang/memory/Scope {
public fun <init> ()V
public fun <init> (Lsk/ainet/lang/memory/trace/TraceSink;Ljava/lang/String;)V
public synthetic fun <init> (Lsk/ainet/lang/memory/trace/TraceSink;Ljava/lang/String;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun adopt (Lsk/ainet/lang/memory/Storage;)Lsk/ainet/lang/memory/Storage;
public fun allocate (JLsk/ainet/lang/tensor/storage/MemoryDomain;Lsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage;
public fun allocateFloats (ILsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage$Heap;
public fun close ()V
public fun getKind ()Lsk/ainet/lang/memory/ScopeKind;
public fun getLiveBytes ()J
public final fun getName ()Ljava/lang/String;
public fun getSink ()Lsk/ainet/lang/memory/trace/TraceSink;
public final fun getStorageCount ()I
public final fun isClosed ()Z
public final fun mapFile (Ljava/lang/String;JJLsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage;
public static synthetic fun mapFile$default (Lsk/ainet/lang/memory/ModelScope;Ljava/lang/String;JJLsk/ainet/lang/tensor/TensorId;ILjava/lang/Object;)Lsk/ainet/lang/memory/Storage;
}

public abstract interface class sk/ainet/lang/memory/Owner {
}

Expand Down Expand Up @@ -823,6 +867,31 @@ public final class sk/ainet/lang/memory/PlatformStorageInfo {
public fun toString ()Ljava/lang/String;
}

public abstract interface class sk/ainet/lang/memory/Scope : java/lang/AutoCloseable {
public abstract fun allocate (JLsk/ainet/lang/tensor/storage/MemoryDomain;Lsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage;
public static synthetic fun allocate$default (Lsk/ainet/lang/memory/Scope;JLsk/ainet/lang/tensor/storage/MemoryDomain;Lsk/ainet/lang/tensor/TensorId;ILjava/lang/Object;)Lsk/ainet/lang/memory/Storage;
public abstract fun allocateFloats (ILsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage$Heap;
public static synthetic fun allocateFloats$default (Lsk/ainet/lang/memory/Scope;ILsk/ainet/lang/tensor/TensorId;ILjava/lang/Object;)Lsk/ainet/lang/memory/Storage$Heap;
public abstract fun getKind ()Lsk/ainet/lang/memory/ScopeKind;
public abstract fun getLiveBytes ()J
public abstract fun getSink ()Lsk/ainet/lang/memory/trace/TraceSink;
}

public final class sk/ainet/lang/memory/Scope$Ambient : sk/ainet/lang/memory/Scope {
public static final field INSTANCE Lsk/ainet/lang/memory/Scope$Ambient;
public fun allocate (JLsk/ainet/lang/tensor/storage/MemoryDomain;Lsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage;
public fun allocateFloats (ILsk/ainet/lang/tensor/TensorId;)Lsk/ainet/lang/memory/Storage$Heap;
public fun close ()V
public fun getKind ()Lsk/ainet/lang/memory/ScopeKind;
public fun getLiveBytes ()J
public fun getSink ()Lsk/ainet/lang/memory/trace/TraceSink;
}

public final class sk/ainet/lang/memory/Scope$DefaultImpls {
public static synthetic fun allocate$default (Lsk/ainet/lang/memory/Scope;JLsk/ainet/lang/tensor/storage/MemoryDomain;Lsk/ainet/lang/tensor/TensorId;ILjava/lang/Object;)Lsk/ainet/lang/memory/Storage;
public static synthetic fun allocateFloats$default (Lsk/ainet/lang/memory/Scope;ILsk/ainet/lang/tensor/TensorId;ILjava/lang/Object;)Lsk/ainet/lang/memory/Storage$Heap;
}

public final class sk/ainet/lang/memory/ScopeKind : java/lang/Enum {
public static final field AMBIENT Lsk/ainet/lang/memory/ScopeKind;
public static final field FORWARD Lsk/ainet/lang/memory/ScopeKind;
Expand Down Expand Up @@ -1501,6 +1570,7 @@ public final class sk/ainet/lang/nn/DefaultNeuralNetworkExecutionContext : sk/ai
public fun getInTraining ()Z
public fun getMemoryInfo ()Lsk/ainet/context/MemoryInfo;
public fun getMemoryPlanner ()Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public fun getMemoryScope ()Lsk/ainet/lang/memory/Scope;
public fun getMemoryTracker ()Lsk/ainet/lang/tensor/storage/MemoryTracker;
public fun getObservers ()Lsk/ainet/context/ExecutionObserverRegistry;
public fun getOps ()Lsk/ainet/lang/tensor/ops/TensorOps;
Expand Down Expand Up @@ -1837,6 +1907,7 @@ public final class sk/ainet/lang/nn/NeuralNetworkExecutionContext$DefaultImpls {
public static fun getHooks (Lsk/ainet/lang/nn/NeuralNetworkExecutionContext;)Lsk/ainet/lang/nn/hooks/ForwardHooks;
public static fun getInTraining (Lsk/ainet/lang/nn/NeuralNetworkExecutionContext;)Z
public static fun getMemoryPlanner (Lsk/ainet/lang/nn/NeuralNetworkExecutionContext;)Lsk/ainet/lang/tensor/storage/MemoryPlanner;
public static fun getMemoryScope (Lsk/ainet/lang/nn/NeuralNetworkExecutionContext;)Lsk/ainet/lang/memory/Scope;
public static fun getMemoryTracker (Lsk/ainet/lang/nn/NeuralNetworkExecutionContext;)Lsk/ainet/lang/tensor/storage/MemoryTracker;
public static fun getScratch (Lsk/ainet/lang/nn/NeuralNetworkExecutionContext;)Lsk/ainet/lang/tensor/scratch/ScratchPool;
public static fun getTraceSink (Lsk/ainet/lang/nn/NeuralNetworkExecutionContext;)Lsk/ainet/lang/memory/trace/TraceSink;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ public interface ExecutionContext {
@sk.ainet.lang.memory.ExperimentalMemoryApi
public val traceSink: sk.ainet.lang.memory.trace.TraceSink get() = sk.ainet.lang.memory.trace.NoopTraceSink

/**
* The scope new activations and adapter outputs are allocated in (SKEEP-003 §4.5). Default
* [sk.ainet.lang.memory.Scope.Ambient] — GC-managed, today's behaviour; a generation loop opts
* in by providing a `ForwardScope` and calling `reset()` per step.
*/
@sk.ainet.lang.memory.ExperimentalMemoryApi
public val memoryScope: sk.ainet.lang.memory.Scope get() = sk.ainet.lang.memory.Scope.Ambient

public val ops: TensorOps

// Optional forward hooks for recording or diagnostics (null → disabled)
Expand Down
Loading
Loading