Skip to content

Commit 11a85b5

Browse files
committed
fix: cast some ops to float
1 parent 5b3e7d7 commit 11a85b5

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

.github/workflows/Documenter.yaml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ name: Documentation
33
on:
44
pull_request:
55
paths:
6-
- '.github/workflows/Documenter.yaml'
7-
- 'docs/**'
8-
- 'lib/**'
9-
- 'src/**'
6+
- ".github/workflows/Documenter.yaml"
7+
- "docs/**"
8+
- "lib/**"
9+
- "src/**"
1010
push:
1111
branches:
1212
- main
13-
tags: '*'
13+
tags: "*"
1414
paths:
15-
- '.github/workflows/Documenter.yaml'
16-
- 'docs/**'
17-
- 'lib/**'
18-
- 'src/**'
15+
- ".github/workflows/Documenter.yaml"
16+
- "docs/**"
17+
- "lib/**"
18+
- "src/**"
1919

2020
concurrency:
2121
# Same group concurrency as the `PreviewCleanup.yml` workflow, because they both
@@ -37,22 +37,14 @@ jobs:
3737
- uses: actions/checkout@v4
3838
- uses: julia-actions/setup-julia@v2
3939
with:
40-
version: '1'
40+
version: "1"
4141
- uses: julia-actions/cache@v2
4242
- name: Instantiate docs environment
43+
shell: julia --color=yes --project=docs {0}
4344
run: |
44-
julia --color=yes --project=docs -e '
45-
using Pkg
46-
Pkg.instantiate()'
47-
env:
48-
JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager
49-
- name: Run doctests
50-
run: |
51-
julia --color=yes --project=docs -e '
52-
using Documenter: DocMeta, doctest
53-
using Reactant
54-
DocMeta.setdocmeta!(Reactant, :DocTestSetup, :(using Reactant); recursive=true)
55-
doctest(Reactant)'
45+
using Pkg
46+
Pkg.develop(PackageSpec(path=pwd()))
47+
Pkg.instantiate()
5648
- name: Build documentation
5749
run: julia --color=yes --project=docs docs/make.jl
5850
env:

docs/src/tutorials/sharding.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,15 +271,15 @@ Reactant.addressable_devices()
271271

272272
You can inspect the type of the device, as well as its properties.
273273

274-
## Generating Distributed Data by Concatenating Local-Worker Data
274+
<!-- ## Generating Distributed Data by Concatenating Local-Worker Data
275275
276276
## Handling Replicated Tensors
277277
278278
## Sharding in Neural Networks
279279
280280
### 8-way Batch Parallelism
281281
282-
### 4-way Batch & 2-way Model Parallelism
282+
### 4-way Batch & 2-way Model Parallelism -->
283283

284284
## Related links
285285

src/TracedRNumber.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,28 @@ for (jlop, hloop) in (
416416
@eval $(jlop)(@nospecialize(lhs::TracedRNumber)) = Ops.$(hloop)(lhs)
417417
end
418418

419+
for (jlop, hloop) in (
420+
(:(Base.sin), :sine),
421+
(:(Base.cos), :cosine),
422+
(:(Base.tan), :tan),
423+
(:(Base.tanh), :tanh),
424+
(:(Base.FastMath.tanh_fast), :tanh),
425+
(:(Base.exp), :exponential),
426+
(:(Base.FastMath.exp_fast), :exponential),
427+
(:(Base.expm1), :exponential_minus_one),
428+
(:(Base.log), :log),
429+
(:(Base.log1p), :log_plus_one),
430+
(:(Base.sqrt), :sqrt),
431+
(:(Base.acos), :acos),
432+
(:(Base.acosh), :acosh),
433+
(:(Base.asin), :asin),
434+
(:(Base.asinh), :asinh),
435+
(:(Base.atan), :atan),
436+
(:(Base.atanh), :atanh),
437+
)
438+
@eval $(jlop)(@nospecialize(lhs::TracedRNumber{<:Integer})) = Ops.$(hloop)(float(lhs))
439+
end
440+
419441
for (jlop, hloop) in
420442
((:(Base.sinpi), :sine), (:(Base.cospi), :cosine), (:(Base.tanpi), :tan))
421443
@eval $(jlop)(@nospecialize(lhs::TracedRNumber{T})) where {T} = Ops.$(hloop)(T(π) * lhs)

0 commit comments

Comments
 (0)