Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
d98bfe7e
Commit
d98bfe7e
authored
Apr 03, 2025
by
Michael Yang
Committed by
Michael Yang
Apr 08, 2025
Browse files
kvcache: stub out test structs
parent
6747099d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
111 deletions
+6
-111
kvcache/causal_test.go
kvcache/causal_test.go
+6
-111
No files found.
kvcache/causal_test.go
View file @
d98bfe7e
...
...
@@ -5,7 +5,6 @@ import (
"slices"
"testing"
"github.com/ollama/ollama/fs"
"github.com/ollama/ollama/ml"
"github.com/ollama/ollama/model/input"
)
...
...
@@ -372,14 +371,8 @@ func TestCanResume(t *testing.T) {
}
}
type
testBackend
struct
{}
func
(
b
*
testBackend
)
Config
()
fs
.
Config
{
panic
(
"not implemented"
)
}
func
(
b
*
testBackend
)
Get
(
name
string
)
ml
.
Tensor
{
panic
(
"not implemented"
)
type
testBackend
struct
{
ml
.
Backend
}
func
(
b
*
testBackend
)
NewContext
()
ml
.
Context
{
...
...
@@ -390,12 +383,10 @@ func (b *testBackend) NewContextSize(int) ml.Context {
return
&
testContext
{}
}
func
(
b
*
testBackend
)
SystemInfo
()
str
ing
{
return
"not impleme
nte
d"
type
testContext
str
uct
{
ml
.
Co
nte
xt
}
type
testContext
struct
{}
func
(
c
*
testContext
)
Empty
(
dtype
ml
.
DType
,
shape
...
int
)
ml
.
Tensor
{
total
:=
0
...
...
@@ -449,6 +440,8 @@ func (c *testContext) MaxGraphNodes() int {
func
(
c
*
testContext
)
Close
()
{}
type
testTensor
struct
{
ml
.
Tensor
dtype
ml
.
DType
elementSize
int
data
[]
float32
...
...
@@ -476,10 +469,6 @@ func (t *testTensor) DType() ml.DType {
return
t
.
dtype
}
func
(
t
*
testTensor
)
Bytes
()
[]
byte
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Floats
()
[]
float32
{
out
:=
make
([]
float32
,
len
(
t
.
data
))
copy
(
out
,
t
.
data
)
...
...
@@ -504,64 +493,6 @@ func (t *testTensor) Add(ctx ml.Context, t2 ml.Tensor) ml.Tensor {
return
out
}
func
(
t
*
testTensor
)
Mul
(
ctx
ml
.
Context
,
t2
ml
.
Tensor
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Mulmat
(
ctx
ml
.
Context
,
t2
ml
.
Tensor
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
MulmatFullPrec
(
ctx
ml
.
Context
,
t2
ml
.
Tensor
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Softmax
(
ctx
ml
.
Context
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
LayerNorm
(
ctx
ml
.
Context
,
weight
,
bias
ml
.
Tensor
,
eps
float32
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
RMSNorm
(
ctx
ml
.
Context
,
weight
ml
.
Tensor
,
eps
float32
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Scale
(
ctx
ml
.
Context
,
s
float64
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
AvgPool1D
(
ctx
ml
.
Context
,
k
,
s
,
p
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
AvgPool2D
(
ctx
ml
.
Context
,
k
,
s
int
,
p
float32
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Conv2D
(
ctx
ml
.
Context
,
weight
ml
.
Tensor
,
s0
,
s1
,
p0
,
p1
,
d0
,
d1
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
RoPE
(
ctx
ml
.
Context
,
positionIDs
,
ropeFactors
ml
.
Tensor
,
dim
,
ropeType
uint32
,
base
,
scale
float32
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
IM2Col
(
ctx
ml
.
Context
,
weight
ml
.
Tensor
,
s0
,
s1
,
p0
,
p1
,
d0
,
d1
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Cos
(
ctx
ml
.
Context
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Sin
(
ctx
ml
.
Context
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Tanh
(
ctx
ml
.
Context
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
GELU
(
ctx
ml
.
Context
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
SILU
(
ctx
ml
.
Context
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Reshape
(
ctx
ml
.
Context
,
shape
...
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
View
(
ctx
ml
.
Context
,
offset
int
,
shape
...
int
)
ml
.
Tensor
{
offset
/=
t
.
elementSize
...
...
@@ -584,43 +515,7 @@ func (t *testTensor) View(ctx ml.Context, offset int, shape ...int) ml.Tensor {
return
view
}
func
(
t
*
testTensor
)
Permute
(
ctx
ml
.
Context
,
shape
...
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Contiguous
(
ctx
ml
.
Context
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Set
(
ctx
ml
.
Context
,
t2
ml
.
Tensor
,
offset
int
,
strides
...
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Pad
(
ctx
ml
.
Context
,
shape
...
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Unpad
(
ctx
ml
.
Context
,
shape
...
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Stack
(
ctx
ml
.
Context
,
dim
int
,
s
...
ml
.
Tensor
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Repeat
(
ctx
ml
.
Context
,
dim
,
n
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Concat
(
ctx
ml
.
Context
,
t2
ml
.
Tensor
,
dim
int
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Rows
(
ctx
ml
.
Context
,
t2
ml
.
Tensor
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
func
(
t
*
testTensor
)
Copy
(
ctx
ml
.
Context
,
t2
ml
.
Tensor
)
ml
.
Tensor
{
copy
(
t2
.
(
*
testTensor
)
.
data
,
t
.
data
)
return
nil
}
func
(
t
*
testTensor
)
Duplicate
(
ctx
ml
.
Context
)
ml
.
Tensor
{
panic
(
"not implemented"
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment