NNlib.jl icon indicating copy to clipboard operation
NNlib.jl copied to clipboard

Add minimal infrastructure for the docs

Open Saransh-cpp opened this issue 3 years ago • 2 comments

This currently does not add any new doctests or improve the existing docs, as that would make this PR massive.

Here are the docstrings that are missing from the manual at the moment (I think most of them are a part of the internal API) -

NNlib.predilated_size :: Union{Tuple{M}, Tuple{N}, Tuple{Tuple{Vararg{T, N}} where T, Tuple{Vararg{T, M}} where T}} where {N, M}
NNlib.logσ :: Tuple{Any}
NNlib.transpose_swapbatch :: Tuple{AbstractArray}
NNlib.∇depthwiseconv_data_im2col!
NNlib.glu :: Union{Tuple{Any}, Tuple{Any, Any}}
NNlib.reverse_indices :: Union{Tuple{N}, Tuple{AbstractArray{<:Any, N}}} where N
NNlib.im2col_dims :: Tuple{ConvDims}
NNlib.conv_im2col! :: Union{Tuple{T}, Tuple{AbstractArray{T, 5}, AbstractArray{T, 5}, AbstractArray{T, 5}, DenseConvDims}} where T
NNlib.BatchedTranspose
NNlib.∇conv_data_im2col! :: Union{Tuple{T}, Tuple{AbstractArray{T, 5}, AbstractArray{T, 5}, AbstractArray{T, 5}, DenseConvDims}} where T
NNlib.storage_type :: Tuple{AbstractArray}
NNlib.add_blanks :: Tuple{Any, Any}
NNlib.∇conv_filter_direct!
NNlib.is_strided :: Tuple{StridedArray}
NNlib.depthwiseconv_direct! :: Union{Tuple{wT}, Tuple{xT}, Tuple{yT}, Tuple{AbstractArray{yT, 5}, AbstractArray{xT, 5}, AbstractArray{wT, 5}, DepthwiseConvDims}} where {yT, xT, wT}
NNlib.maximum_dims :: Tuple{AbstractArray{<:Integer}}
NNlib.σ :: Tuple{Any}
NNlib.scatter_dims :: Union{Tuple{Nidx}, Tuple{Ny}, Tuple{Nx}, Tuple{Tidx}, Tuple{Ty}, Tuple{Tx}, Tuple{AbstractArray{Tx, Nx}, AbstractArray{Ty, Ny}, AbstractArray{Tidx, Nidx}}} where {Tx, Ty, Tidx, Nx, Ny, Nidx}
NNlib.hardσ :: Tuple{Any}
NNlib.depthwiseconv_im2col!
NNlib.transpose_pad :: Tuple{ConvDims}
NNlib.conv_direct!
NNlib.∇conv_data_direct!
NNlib.∇depthwiseconv_filter_im2col!
NNlib.col2im!
NNlib.∇conv_filter_im2col! :: Union{Tuple{T}, Tuple{AbstractArray{T, 5}, AbstractArray{T, 5}, AbstractArray{T, 5}, DenseConvDims}} where T
NNlib.predilate :: Union{Tuple{M}, Tuple{N}, Tuple{T}, Tuple{AbstractArray{T, N}, Tuple{Vararg{T, M}} where T}} where {T, N, M}
NNlib.logaddexp :: Tuple{Any, Any}
NNlib.insert_singleton_spatial_dimension :: Tuple{C} where C<:ConvDims
NNlib.safe_div :: Tuple{Any, Any}
NNlib.gemm!
NNlib.∇depthwiseconv_filter_direct!
NNlib.BatchedAdjoint
NNlib.storage_typejoin :: Tuple{Any, Vararg{Any}}
NNlib.fast_act :: Union{Tuple{F}, Tuple{F, AbstractArray}} where F<:Function
NNlib.calc_padding_regions :: Tuple{Any}
NNlib.∇depthwiseconv_data_direct!
NNlib.im2col! :: Union{Tuple{T}, Tuple{AbstractMatrix{T}, AbstractArray{T, 4}, ConvDims}} where T

Saransh-cpp avatar Aug 06 '22 19:08 Saransh-cpp

σ and glu should definitely be public. The rest can stay private for now, I think.

ToucheSir avatar Aug 06 '22 21:08 ToucheSir

σ and glu should definitely be public. The rest can stay private for now, I think.

σ is present in the references as sigmoid. Adding glu!

Saransh-cpp avatar Aug 07 '22 09:08 Saransh-cpp

For some reason I can request a review from only 1 person at a time :(

Saransh-cpp avatar Aug 22 '22 04:08 Saransh-cpp

Is this ready for merging?

Saransh-cpp avatar Aug 29 '22 15:08 Saransh-cpp

What's next, should these show up at https://fluxml.ai/NNlib.jl/dev/ ? If so, should this package's readme link to that?

mcabbott avatar Aug 29 '22 15:08 mcabbott

The documentation should show up on the given link, but I think the GH pages are not enabled for NNlib? Could you please enable the pages from NNlib's settings? Additionally, a DOCUMENTER_KEY should be added as a repository secret in NNlib.jl.

Right now the deployment is failing -

┌ Info: Deployment criteria for deploying devbranch build from GitHub Actions:
│ - ✔ ENV["GITHUB_REPOSITORY"]="FluxML/NNlib.jl" occurs in repo="github.com/FluxML/NNlib.jl.git"
│ - ✔ ENV["GITHUB_EVENT_NAME"]="push" is "push"
│ - ✔ ENV["GITHUB_REF"] matches devbranch="master"
│ - ✔ ENV["GITHUB_ACTOR"] exists
│ - ✔ ENV["DOCUMENTER_KEY"] exists exists
└ Deploying: ✔
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
Initialized empty Git repository in /tmp/jl_wxIzo9/.git/
Failed to add the ECDSA host key for IP address '192.30.255.112' to the list of known hosts (/home/runner/.ssh/known_hosts).
Load key "/home/runner/work/NNlib.jl/NNlib.jl/docs/.documenter": invalid format
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
┌ Error: Git failed to fetch [email protected]:FluxML/NNlib.jl.git
│ This can be caused by a DOCUMENTER_KEY variable that is not correctly set up.
│ Make sure that the environment variable is properly set up as a Base64-encoded string
│ of the SSH private key. You may need to re-generate the keys with DocumenterTools.
└ @ Documenter ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:502
┌ Error: Failed to push:
│   exception =
│    failed process: Process(`git fetch upstream`, ProcessExited(128)) [128]
│    
│    Stacktrace:
│      [1] pipeline_error
│        @ ./process.jl:538 [inlined]
│      [2] run(::Cmd; wait::Bool)
│        @ Base ./process.jl:453
│      [3] run
│        @ ./process.jl:451 [inlined]
│      [4] (::Documenter.var"#git_commands#22"{String, String, SubString{String}, String, Vector{Any}, Bool, String, String})(sshconfig::String)
│        @ Documenter ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:500
│      [5] (::Documenter.var"#21#27"{String})()
│        @ Documenter ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:598
│      [6] cd(f::Documenter.var"#21#27"{String}, dir::String)
│        @ Base.Filesystem ./file.jl:106
│      [7] #20
│        @ ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:598 [inlined]
│      [8] withenv(f::Documenter.var"#20#26"{String, String}, keyvals::Pair{String, String})
│        @ Base ./env.jl:161
│      [9] (::Documenter.var"#19#25"{String, String, SubString{String}})(sshconfig::String, io::IOStream)
│        @ Documenter ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:597
│     [10] mktemp(fn::Documenter.var"#19#25"{String, String, SubString{String}}, parent::String)
│        @ Base.Filesystem ./file.jl:[70](https://github.com/FluxML/NNlib.jl/runs/8074414339?check_suite_focus=true#step:6:71)3
│     [11] mktemp(fn::Function)
│        @ Base.Filesystem ./file.jl:701
│     [12] git_push(root::String, temp::String, repo::String; branch::String, dirname::String, target::String, sha::SubString{String}, devurl::String, versions::Vector{Any}, forcepush::Bool, deploy_config::Documenter.GitHubActions, subfolder::String)
│        @ Documenter ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:582
│     [13] #13
│        @ ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:456 [inlined]
│     [14] mktempdir(fn::Documenter.var"#13#15"{SubString{String}, String, String, String, String, String, String, Vector{Any}, Bool, Documenter.GitHubActions, String}, parent::String; prefix::String)
│        @ Base.Filesystem ./file.jl:[72](https://github.com/FluxML/NNlib.jl/runs/8074414339?check_suite_focus=true#step:6:73)9
│     [15] mktempdir(fn::Function, parent::String) (repeats 2 times)
│        @ Base.Filesystem ./file.jl:727
│     [16] (::Documenter.var"#12#14"{String, String, String, String, String, Nothing, String, Vector{Any}, Bool, Documenter.GitHubActions, String})()
│        @ Documenter ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:455
│     [17] cd(f::Documenter.var"#12#14"{String, String, String, String, String, Nothing, String, Vector{Any}, Bool, Documenter.GitHubActions, String}, dir::String)
│        @ Base.Filesystem ./file.jl:106
│     [18] deploydocs(; root::String, target::String, dirname::String, repo::String, branch::String, deps::Nothing, make::Nothing, devbranch::String, devurl::String, versions::Vector{Any}, forcepush::Bool, deploy_config::Documenter.GitHubActions, push_preview::Bool)
│        @ Documenter ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:432
│     [19] top-level scope
│        @ ~/work/NNlib.jl/NNlib.jl/docs/make.jl:17
│     [20] include(mod::Module, _path::String)
│        @ Base ./Base.jl:3[84](https://github.com/FluxML/NNlib.jl/runs/8074414339?check_suite_focus=true#step:6:85)
│     [21] exec_options(opts::Base.JLOptions)
│        @ Base ./client.jl:2[85](https://github.com/FluxML/NNlib.jl/runs/8074414339?check_suite_focus=true#step:6:86)
│     [22] _start()
│        @ Base ./client.jl:485
└ @ Documenter ~/.julia/packages/Documenter/PLD7m/src/Documenter.jl:603

Saransh-cpp avatar Aug 29 '22 16:08 Saransh-cpp

Btw the docs issue is now taken care of. Do we want the link in the README to point to the dedicated docs?

darsnack avatar Oct 21 '22 19:10 darsnack

And we should also add the URL in GitHub's "About" section

Saransh-cpp avatar Oct 22 '22 19:10 Saransh-cpp