Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EzPC-Custom
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rasoul Akhavan Mahdavi
EzPC-Custom
Commits
3689a4e1
Commit
3689a4e1
authored
4 years ago
by
Pratik Bhatu
Browse files
Options
Downloads
Patches
Plain Diff
Add addv2, fusedbatchnormv3, softmax(identity)
parent
051c6a41
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Athos/TFCompiler/TFNodesAST.py
+17
-1
17 additions, 1 deletion
Athos/TFCompiler/TFNodesAST.py
Athos/TFEzPCLibrary/Library32_cpp.ezpc
+2
-2
2 additions, 2 deletions
Athos/TFEzPCLibrary/Library32_cpp.ezpc
Athos/TFEzPCLibrary/Library64_cpp.ezpc
+2
-2
2 additions, 2 deletions
Athos/TFEzPCLibrary/Library64_cpp.ezpc
with
21 additions
and
5 deletions
Athos/TFCompiler/TFNodesAST.py
+
17
−
1
View file @
3689a4e1
...
@@ -116,6 +116,13 @@ class TFNodesAST:
...
@@ -116,6 +116,13 @@ class TFNodesAST:
TFNodesAST
.
getOperatorsIdx
(
'
+
'
),
TFNodesAST
.
getOperatorsIdx
(
'
+
'
),
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
1
]])
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
1
]])
))
))
def
AddV2
(
graph
:
Graph
.
Graph
,
curNode
:
Graph
.
Node
,
dictNodeNameToOutVarStr
:
dict
,
extraNodeInfoDict
:
dict
):
inputsRef
=
curNode
.
getInputsRef
()
assert
(
len
(
inputsRef
)
==
2
)
return
(
None
,
AST
.
BOp
(
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
0
]]),
TFNodesAST
.
getOperatorsIdx
(
'
+
'
),
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
1
]])
))
def
Mul
(
graph
:
Graph
.
Graph
,
curNode
:
Graph
.
Node
,
dictNodeNameToOutVarStr
:
dict
,
extraNodeInfoDict
:
dict
):
def
Mul
(
graph
:
Graph
.
Graph
,
curNode
:
Graph
.
Node
,
dictNodeNameToOutVarStr
:
dict
,
extraNodeInfoDict
:
dict
):
inputsRef
=
curNode
.
getInputsRef
()
inputsRef
=
curNode
.
getInputsRef
()
...
@@ -533,6 +540,12 @@ class TFNodesAST:
...
@@ -533,6 +540,12 @@ class TFNodesAST:
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
1
]]),
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
1
]]),
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
2
]]),
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
2
]]),
))
))
def
FusedBatchNormV3
(
graph
:
Graph
.
Graph
,
curNode
:
Graph
.
Node
,
dictNodeNameToOutVarStr
:
dict
,
extraNodeInfoDict
:
dict
):
inputsRef
=
curNode
.
getInputsRef
()
return
(
None
,
AST
.
FusedBatchNorm
(
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
0
]]),
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
1
]]),
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
2
]]),
))
def
Squeeze
(
graph
:
Graph
.
Graph
,
curNode
:
Graph
.
Node
,
dictNodeNameToOutVarStr
:
dict
,
extraNodeInfoDict
:
dict
):
def
Squeeze
(
graph
:
Graph
.
Graph
,
curNode
:
Graph
.
Node
,
dictNodeNameToOutVarStr
:
dict
,
extraNodeInfoDict
:
dict
):
# TODO : Do this in somewhat better way
# TODO : Do this in somewhat better way
...
@@ -563,6 +576,9 @@ class TFNodesAST:
...
@@ -563,6 +576,9 @@ class TFNodesAST:
inputsRef
=
curNode
.
getInputsRef
()
inputsRef
=
curNode
.
getInputsRef
()
return
(
None
,
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
0
]]))
return
(
None
,
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
0
]]))
def
Softmax
(
graph
:
Graph
.
Graph
,
curNode
:
Graph
.
Node
,
dictNodeNameToOutVarStr
:
dict
,
extraNodeInfoDict
:
dict
):
inputsRef
=
curNode
.
getInputsRef
()
return
(
None
,
AST
.
ID
(
dictNodeNameToOutVarStr
[
inputsRef
[
0
]]))
# def StridedSlice(graph : Graph.Graph, curNode : Graph.Node, dictNodeNameToOutVarStr : dict, extraNodeInfoDict : dict):
# def StridedSlice(graph : Graph.Graph, curNode : Graph.Node, dictNodeNameToOutVarStr : dict, extraNodeInfoDict : dict):
# inputsRef = curNode.getInputsRef()
# inputsRef = curNode.getInputsRef()
# return (None, AST.ID(dictNodeNameToOutVarStr[inputsRef[0]]))
# return (None, AST.ID(dictNodeNameToOutVarStr[inputsRef[0]]))
...
@@ -575,4 +591,4 @@ class TFNodesAST:
...
@@ -575,4 +591,4 @@ class TFNodesAST:
# retAST = AST.UninterpFuncCall(extraNodeInfoDict[curNode.getName()][0],
# retAST = AST.UninterpFuncCall(extraNodeInfoDict[curNode.getName()][0],
# TFNodesAST.UninterpFuncCallNames.Pack.name,
# TFNodesAST.UninterpFuncCallNames.Pack.name,
# list(map(lambda x : AST.ID(dictNodeNameToOutVarStr[x]), inputsRef)) + [AST.Int(axis)] )
# list(map(lambda x : AST.ID(dictNodeNameToOutVarStr[x]), inputsRef)) + [AST.Int(axis)] )
# return (None, retAST)
# return (None, retAST)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Athos/TFEzPCLibrary/Library32_cpp.ezpc
+
2
−
2
View file @
3689a4e1
...
@@ -278,7 +278,7 @@ def void FusedBatchNorm4411(int32_pl s1, int32_pl s2, int32_pl s3, int32_pl s4,
...
@@ -278,7 +278,7 @@ def void FusedBatchNorm4411(int32_pl s1, int32_pl s2, int32_pl s3, int32_pl s4,
def void ReduceMean24(int32_pl outS1, int32_pl outS2,
def void ReduceMean24(int32_pl outS1, int32_pl outS2,
int32_pl inS1, int32_pl inS2, int32_pl inS3, int32_pl inS4,
int32_pl inS1, int32_pl inS2, int32_pl inS3, int32_pl inS4,
int32_al[inS1][inS2][inS3][inS4] inputArr,
int32_al[inS1][inS2][inS3][inS4] inputArr,
int32_
p
l[2] axes,
int32_
a
l[2] axes,
int32_al[outS1][outS2] outputArr
int32_al[outS1][outS2] outputArr
)
)
{
{
...
@@ -332,4 +332,4 @@ def void StartComputation()
...
@@ -332,4 +332,4 @@ def void StartComputation()
def void EndComputation()
def void EndComputation()
{
{
return;
return;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Athos/TFEzPCLibrary/Library64_cpp.ezpc
+
2
−
2
View file @
3689a4e1
...
@@ -278,7 +278,7 @@ def void FusedBatchNorm4411(int32_pl s1, int32_pl s2, int32_pl s3, int32_pl s4,
...
@@ -278,7 +278,7 @@ def void FusedBatchNorm4411(int32_pl s1, int32_pl s2, int32_pl s3, int32_pl s4,
def void ReduceMean24(int32_pl outS1, int32_pl outS2,
def void ReduceMean24(int32_pl outS1, int32_pl outS2,
int32_pl inS1, int32_pl inS2, int32_pl inS3, int32_pl inS4,
int32_pl inS1, int32_pl inS2, int32_pl inS3, int32_pl inS4,
int64_al[inS1][inS2][inS3][inS4] inputArr,
int64_al[inS1][inS2][inS3][inS4] inputArr,
int
32_p
l[2] axes,
int
64_a
l[2] axes,
int64_al[outS1][outS2] outputArr
int64_al[outS1][outS2] outputArr
)
)
{
{
...
@@ -332,4 +332,4 @@ def void StartComputation()
...
@@ -332,4 +332,4 @@ def void StartComputation()
def void EndComputation()
def void EndComputation()
{
{
return;
return;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment