提交 d9ed1e2c authored 作者: Virgile Andreani's avatar Virgile Andreani 提交者: Virgile Andreani

Fix typo amblibm -> amdlibm

上级 7a0175af
...@@ -355,7 +355,7 @@ import ``pytensor`` and print the config variable, as in: ...@@ -355,7 +355,7 @@ import ``pytensor`` and print the config variable, as in:
When ``True``, ignore the first call to an PyTensor function while profiling. When ``True``, ignore the first call to an PyTensor function while profiling.
.. attribute:: config.lib__amblibm .. attribute:: config.lib__amdlibm
Bool value: either ``True`` or ``False`` Bool value: either ``True`` or ``False``
......
...@@ -1566,26 +1566,26 @@ class ProfileStats: ...@@ -1566,26 +1566,26 @@ class ProfileStats:
printed_tip = True printed_tip = True
# tip 2 # tip 2
if not config.lib__amblibm and any( if not config.lib__amdlibm and any(
amdlibm_speed_up(a.op) for (fgraph, a) in self.apply_time amdlibm_speed_up(a.op) for (fgraph, a) in self.apply_time
): ):
print( print(
" - Try installing amdlibm and set the PyTensor flag " " - Try installing amdlibm and set the PyTensor flag "
"lib__amblibm=True. This speeds up only some Elemwise " "lib__amdlibm=True. This speeds up only some Elemwise "
"operation.", "operation.",
file=file, file=file,
) )
printed_tip = True printed_tip = True
# tip 3 # tip 3
if not config.lib__amblibm and any( if not config.lib__amdlibm and any(
exp_float32_op(a.op) and a.inputs[0].dtype == "float32" exp_float32_op(a.op) and a.inputs[0].dtype == "float32"
for (fgraph, a) in self.apply_time for (fgraph, a) in self.apply_time
): ):
print( print(
" - With the default gcc libm, exp in float32 is slower " " - With the default gcc libm, exp in float32 is slower "
"than in float64! Try PyTensor flag floatX=float64, or " "than in float64! Try PyTensor flag floatX=float64, or "
"install amdlibm and set the pytensor flags lib__amblibm=True", "install amdlibm and set the pytensor flags lib__amdlibm=True",
file=file, file=file,
) )
printed_tip = True printed_tip = True
......
...@@ -547,7 +547,7 @@ def add_tensor_configvars(): ...@@ -547,7 +547,7 @@ def add_tensor_configvars():
# http://developer.amd.com/CPU/LIBRARIES/LIBM/Pages/default.aspx # http://developer.amd.com/CPU/LIBRARIES/LIBM/Pages/default.aspx
config.add( config.add(
"lib__amblibm", "lib__amdlibm",
"Use amd's amdlibm numerical library", "Use amd's amdlibm numerical library",
BoolParam(False), BoolParam(False),
# Added elsewhere in the c key only when needed. # Added elsewhere in the c key only when needed.
......
...@@ -95,7 +95,7 @@ class PyTensorConfigParser: ...@@ -95,7 +95,7 @@ class PyTensorConfigParser:
compile__timeout: int compile__timeout: int
# add_tensor_configvars # add_tensor_configvars
tensor__cmp_sloppy: int tensor__cmp_sloppy: int
lib__amblibm: bool lib__amdlibm: bool
tensor__insert_inplace_optimizer_validate_nb: int tensor__insert_inplace_optimizer_validate_nb: int
# add_traceback_configvars # add_traceback_configvars
traceback__limit: int traceback__limit: int
......
...@@ -356,18 +356,18 @@ class ScalarType(CType, HasDataType, HasShape): ...@@ -356,18 +356,18 @@ class ScalarType(CType, HasDataType, HasShape):
# we declare them here and they will be re-used by TensorType # we declare them here and they will be re-used by TensorType
l.append("<numpy/arrayobject.h>") l.append("<numpy/arrayobject.h>")
l.append("<numpy/arrayscalars.h>") l.append("<numpy/arrayscalars.h>")
if config.lib__amblibm and c_compiler.supports_amdlibm: if config.lib__amdlibm and c_compiler.supports_amdlibm:
l += ["<amdlibm.h>"] l += ["<amdlibm.h>"]
return l return l
def c_libraries(self, c_compiler=None, **kwargs): def c_libraries(self, c_compiler=None, **kwargs):
l = [] l = []
if config.lib__amblibm and c_compiler and c_compiler.supports_amdlibm: if config.lib__amdlibm and c_compiler and c_compiler.supports_amdlibm:
l += ["amdlibm"] l += ["amdlibm"]
return l return l
def c_compile_args(self, c_compiler=None, **kwargs): def c_compile_args(self, c_compiler=None, **kwargs):
if config.lib__amblibm and c_compiler and c_compiler.supports_amdlibm: if config.lib__amdlibm and c_compiler and c_compiler.supports_amdlibm:
return ["-DREPLACE_WITH_AMDLIBM"] return ["-DREPLACE_WITH_AMDLIBM"]
else: else:
return [] return []
...@@ -1245,7 +1245,7 @@ class UnaryScalarOp(ScalarOp): ...@@ -1245,7 +1245,7 @@ class UnaryScalarOp(ScalarOp):
def c_code_contiguous(self, node, name, inputs, outputs, sub): def c_code_contiguous(self, node, name, inputs, outputs, sub):
(x,) = inputs (x,) = inputs
(z,) = outputs (z,) = outputs
if not config.lib__amblibm or node.inputs[0].type != node.outputs[0].type: if not config.lib__amdlibm or node.inputs[0].type != node.outputs[0].type:
raise MethodNotDefined() raise MethodNotDefined()
dtype = node.inputs[0].type.dtype_specs()[1] dtype = node.inputs[0].type.dtype_specs()[1]
...@@ -1260,7 +1260,7 @@ class UnaryScalarOp(ScalarOp): ...@@ -1260,7 +1260,7 @@ class UnaryScalarOp(ScalarOp):
""" """
def c_code_contiguous_raw(self, dtype, n, i, o): def c_code_contiguous_raw(self, dtype, n, i, o):
if not config.lib__amblibm: if not config.lib__amdlibm:
raise MethodNotDefined() raise MethodNotDefined()
if dtype.startswith("npy_"): if dtype.startswith("npy_"):
dtype = dtype[4:] dtype = dtype[4:]
...@@ -2296,7 +2296,7 @@ class Pow(BinaryScalarOp): ...@@ -2296,7 +2296,7 @@ class Pow(BinaryScalarOp):
def c_code_contiguous(self, node, name, inputs, outputs, sub): def c_code_contiguous(self, node, name, inputs, outputs, sub):
(x, y) = inputs (x, y) = inputs
(z,) = outputs (z,) = outputs
if not config.lib__amblibm: if not config.lib__amdlibm:
raise MethodNotDefined() raise MethodNotDefined()
# We compare the dtype AND the broadcast flag # We compare the dtype AND the broadcast flag
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论