Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Bindgen
pystencils
Commits
bd49f37e
Commit
bd49f37e
authored
5 years ago
by
Stephan Seitz
Committed by
Martin Bauer
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add pystencils.autodiff
parent
eaeec78a
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
pystencils/__init__.py
+6
-0
6 additions, 0 deletions
pystencils/__init__.py
pystencils/autodiff.py
+14
-0
14 additions, 0 deletions
pystencils/autodiff.py
setup.py
+10
-8
10 additions, 8 deletions
setup.py
with
31 additions
and
8 deletions
README.md
+
1
−
0
View file @
bd49f37e
...
@@ -55,6 +55,7 @@ All options:
...
@@ -55,6 +55,7 @@ All options:
-
`alltrafos`
: pulls in additional dependencies for loop simplification e.g. libisl
-
`alltrafos`
: pulls in additional dependencies for loop simplification e.g. libisl
-
`bench_db`
: functionality to store benchmark result in object databases
-
`bench_db`
: functionality to store benchmark result in object databases
-
`interactive`
: installs dependencies to work in Jupyter including image I/O, plotting etc.
-
`interactive`
: installs dependencies to work in Jupyter including image I/O, plotting etc.
-
`autodiff`
: enable derivation of adjoint kernels and generation of Torch/Tensorflow operations
-
`doc`
: packages to build documentation
-
`doc`
: packages to build documentation
Options can be combined e.g.
Options can be combined e.g.
...
...
This diff is collapsed.
Click to expand it.
pystencils/__init__.py
+
6
−
0
View file @
bd49f37e
...
@@ -13,6 +13,12 @@ from .simp import AssignmentCollection
...
@@ -13,6 +13,12 @@ from .simp import AssignmentCollection
from
.slicing
import
make_slice
from
.slicing
import
make_slice
from
.sympyextensions
import
SymbolCreator
from
.sympyextensions
import
SymbolCreator
try
:
import
pystencils_autodiff
autodiff
=
pystencils_autodiff
except
ImportError
:
pass
__all__
=
[
'
Field
'
,
'
FieldType
'
,
'
fields
'
,
__all__
=
[
'
Field
'
,
'
FieldType
'
,
'
fields
'
,
'
TypedSymbol
'
,
'
TypedSymbol
'
,
'
make_slice
'
,
'
make_slice
'
,
...
...
This diff is collapsed.
Click to expand it.
pystencils/autodiff.py
0 → 100644
+
14
−
0
View file @
bd49f37e
"""
Provides tools for generation of auto-differentiable operations.
See https://github.com/theHamsta/pystencils_autodiff
Installation:
.. code-block:: bash
pip install pystencils-autodiff
"""
import
os
if
'
CI
'
not
in
os
.
environ
:
raise
NotImplementedError
(
'
pystencils-autodiff is not installed. Run `pip install pystencils-autodiff`
'
)
This diff is collapsed.
Click to expand it.
setup.py
+
10
−
8
View file @
bd49f37e
import
distutils
import
io
import
os
import
os
import
sys
import
sys
import
io
from
setuptools
import
setup
,
find_packages
import
distutils
from
distutils.extension
import
Extension
from
contextlib
import
redirect_stdout
from
contextlib
import
redirect_stdout
from
distutils.extension
import
Extension
from
importlib
import
import_module
from
importlib
import
import_module
from
setuptools
import
find_packages
,
setup
if
'
--use-cython
'
in
sys
.
argv
:
if
'
--use-cython
'
in
sys
.
argv
:
USE_CYTHON
=
True
USE_CYTHON
=
True
sys
.
argv
.
remove
(
'
--use-cython
'
)
sys
.
argv
.
remove
(
'
--use-cython
'
)
else
:
else
:
USE_CYTHON
=
False
USE_CYTHON
=
False
quick_tests
=
[
quick_tests
=
[
'
test_datahandling.test_kernel
'
,
'
test_datahandling.test_kernel
'
,
'
test_blocking_staggered.test_blocking_staggered
'
,
'
test_blocking_staggered.test_blocking_staggered
'
,
...
@@ -52,6 +52,7 @@ class SimpleTestRunner(distutils.cmd.Command):
...
@@ -52,6 +52,7 @@ class SimpleTestRunner(distutils.cmd.Command):
for
test
in
quick_tests
:
for
test
in
quick_tests
:
self
.
_run_tests_in_module
(
test
)
self
.
_run_tests_in_module
(
test
)
def
readme
():
def
readme
():
with
open
(
'
README.md
'
)
as
f
:
with
open
(
'
README.md
'
)
as
f
:
return
f
.
read
()
return
f
.
read
()
...
@@ -69,13 +70,13 @@ def cython_extensions(*extensions):
...
@@ -69,13 +70,13 @@ def cython_extensions(*extensions):
try
:
try
:
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'
doc
'
))
sys
.
path
.
insert
(
0
,
os
.
path
.
abspath
(
'
doc
'
))
from
version_from_git
import
version_number_from_git
from
version_from_git
import
version_number_from_git
version
=
version_number_from_git
()
version
=
version_number_from_git
()
with
open
(
"
RELEASE-VERSION
"
,
"
w
"
)
as
f
:
with
open
(
"
RELEASE-VERSION
"
,
"
w
"
)
as
f
:
f
.
write
(
version
)
f
.
write
(
version
)
except
ImportError
:
except
ImportError
:
version
=
open
(
'
RELEASE-VERSION
'
,
'
r
'
).
read
()
version
=
open
(
'
RELEASE-VERSION
'
,
'
r
'
).
read
()
setup
(
name
=
'
pystencils
'
,
setup
(
name
=
'
pystencils
'
,
description
=
'
Speeding up stencil computations on CPUs and GPUs
'
,
description
=
'
Speeding up stencil computations on CPUs and GPUs
'
,
version
=
version
,
version
=
version
,
...
@@ -88,7 +89,7 @@ setup(name='pystencils',
...
@@ -88,7 +89,7 @@ setup(name='pystencils',
packages
=
[
'
pystencils
'
]
+
[
'
pystencils.
'
+
s
for
s
in
find_packages
(
'
pystencils
'
)],
packages
=
[
'
pystencils
'
]
+
[
'
pystencils.
'
+
s
for
s
in
find_packages
(
'
pystencils
'
)],
install_requires
=
[
'
sympy>=1.1
'
,
'
numpy
'
,
'
appdirs
'
,
'
joblib
'
],
install_requires
=
[
'
sympy>=1.1
'
,
'
numpy
'
,
'
appdirs
'
,
'
joblib
'
],
package_data
=
{
'
pystencils
'
:
[
'
include/*.h
'
,
'
backends/cuda_known_functions.txt
'
]},
package_data
=
{
'
pystencils
'
:
[
'
include/*.h
'
,
'
backends/cuda_known_functions.txt
'
]},
ext_modules
=
cython_extensions
(
"
pystencils.boundaries.createindexlistcython
"
),
ext_modules
=
cython_extensions
(
"
pystencils.boundaries.createindexlistcython
"
),
classifiers
=
[
classifiers
=
[
'
Development Status :: 4 - Beta
'
,
'
Development Status :: 4 - Beta
'
,
'
Framework :: Jupyter
'
,
'
Framework :: Jupyter
'
,
...
@@ -108,6 +109,7 @@ setup(name='pystencils',
...
@@ -108,6 +109,7 @@ setup(name='pystencils',
'
alltrafos
'
:
[
'
islpy
'
,
'
py-cpuinfo
'
],
'
alltrafos
'
:
[
'
islpy
'
,
'
py-cpuinfo
'
],
'
bench_db
'
:
[
'
blitzdb
'
,
'
pymongo
'
,
'
pandas
'
],
'
bench_db
'
:
[
'
blitzdb
'
,
'
pymongo
'
,
'
pandas
'
],
'
interactive
'
:
[
'
matplotlib
'
,
'
ipy_table
'
,
'
imageio
'
,
'
jupyter
'
,
'
pyevtk
'
],
'
interactive
'
:
[
'
matplotlib
'
,
'
ipy_table
'
,
'
imageio
'
,
'
jupyter
'
,
'
pyevtk
'
],
'
autodiff
'
:
[
'
pystencils-autodiff
'
],
'
doc
'
:
[
'
sphinx
'
,
'
sphinx_rtd_theme
'
,
'
nbsphinx
'
,
'
doc
'
:
[
'
sphinx
'
,
'
sphinx_rtd_theme
'
,
'
nbsphinx
'
,
'
sphinxcontrib-bibtex
'
,
'
sphinx_autodoc_typehints
'
,
'
pandoc
'
],
'
sphinxcontrib-bibtex
'
,
'
sphinx_autodoc_typehints
'
,
'
pandoc
'
],
},
},
...
...
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