updated for versioning

This commit is contained in:
sugarme 2023-10-11 11:56:28 +11:00
parent 7153719f59
commit 511dd161b0
2 changed files with 23 additions and 26 deletions

View File

@ -6,15 +6,21 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [Nofix]
- ctype `long` caused compiling error in MacOS as noted on [#44]. Not working on linux box.
# [0.8.0]
- Upgrade libtorch v2.0.0
- Switched to use hybrid of Go garbage collection and manually memory management
- Fixed #100 #102
- Fixed incorrect indexing at `dutil/Dataset.Next()`
- Added `nn.MSELoss()`
- reworked `ts.Format()`
- Added conv2d benchmark
- Fixed #88 memory leak at `example/char-rnn`
## [Nofix]
- ctype `long` caused compiling error in MacOS as noted on [#44]. Not working on linux box.
## [0.7.0]
- Added `WsName` and `BsName` fields to `nn.LayerNorm.Config`
- [#70] Upgraded to libtorch 1.11
@ -213,3 +219,5 @@ Same as [0.3.10]
[#45]: https://github.com/sugarme/gotch/issues/45
[#48]: https://github.com/sugarme/gotch/issues/48
[#58]: https://github.com/sugarme/gotch/issues/58
[#100]: https://github.com/sugarme/gotch/issues/100
[#102]: https://github.com/sugarme/gotch/issues/102

View File

@ -3,10 +3,10 @@
## Overview
`gotch` creates a thin wrapper to Pytorch C++ APIs (Libtorch) to make use of its already optimized C++ tensor APIs (~ 2209) and dynamic graph computation with CUDA support and provides idiomatic Go APIs for developing and implementing Deep Learning in Go.
`gotch` creates a thin wrapper to Pytorch C++ APIs (Libtorch) to make use of its already optimized C++ tensor APIs (>2500) and dynamic graph computation with CUDA support and provides idiomatic Go APIs for developing and implementing Deep Learning in Go.
**Some features are**
- [x] Comprehensive Pytorch tensor APIs (~ 1891)
- [x] Comprehensive Pytorch tensor APIs
- [x] Fully featured Pytorch dynamic graph computation
- [x] JIT interface to run model trained/saved using PyTorch Python API
- [x] Load pretrained Pytorch models and run inference
@ -16,15 +16,15 @@
`gotch` is in active development mode and may have API breaking changes. Feel free to pull request, report issues or discuss any concerns. All contributions are welcome.
`gotch` current version is **v0.7.0**
`gotch` current version is **v0.8.0**
## Dependencies
- **Libtorch** C++ v1.11.0 library of [Pytorch](https://pytorch.org/)
- **Libtorch** C++ v2.0.1 library of [Pytorch](https://pytorch.org/)
## Installation
- Default CUDA version is `11.3` if CUDA is available otherwise using CPU version.
- Default CUDA version is `11.8` if CUDA is available otherwise using CPU version.
- Default Pytorch C++ API version is `1.11.0`
**NOTE**: `libtorch` will be installed at **`/usr/local/lib`**
@ -34,7 +34,7 @@
#### Step 1: Setup libtorch (skip this step if a valid libtorch already installed in your machine!)
```bash
wget https://raw.githubusercontent.com/sugarme/gotch/master/setup-libtorch.sh
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-libtorch.sh
chmod +x setup-libtorch.sh
export CUDA_VER=cpu && bash setup-libtorch.sh
```
@ -51,9 +51,9 @@
#### Step 2: Setup gotch
```bash
wget https://raw.githubusercontent.com/sugarme/gotch/master/setup-gotch.sh
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-gotch.sh
chmod +x setup-gotch.sh
export CUDA_VER=cpu && export GOTCH_VER=v0.7.0 && bash setup-gotch.sh
export CUDA_VER=cpu && export GOTCH_VER=v0.8.0 && bash setup-gotch.sh
```
### GPU
@ -66,19 +66,11 @@
#### Step 1: Setup libtorch (skip this step if a valid libtorch already installed in your machine!)
**IMPORTANT NOTE FOR CUDA 11.1**:
- Pytorch has not provided `libtorch-1.11` for CUDA 11.1 yet
- If you have CUDA 11.1 installed in your machine and try to install `libtorch-1.11` for CUDA 11.3, you might have [linking issue here](https://github.com/pytorch/pytorch/issues/73829)
- Download and install [nightly libtorch 1.11 for CUDA 11.1](https://download.pytorch.org/libtorch/nightly/cu113/libtorch-cxx11-abi-shared-with-deps-latest.zip) will help `gotch` compiled successfully.
```bash
wget https://raw.githubusercontent.com/sugarme/gotch/master/setup-libtorch.sh
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-libtorch.sh
chmod +x setup-libtorch.sh
# CUDA 10.2
export CUDA_VER=10.2 && bash setup-libtorch.sh
# CUDA 11.3
export CUDA_VER=11.3 && bash setup-libtorch.sh
export CUDA_VER=11.8 && bash setup-libtorch.sh
```
**Update Environment**: in Debian/Ubuntu, add/update the following lines to `.bashrc` file
@ -93,12 +85,9 @@
#### Step 2: Setup gotch
```bash
wget https://raw.githubusercontent.com/sugarme/gotch/master/setup-gotch.sh
wget https://github.com/sugarme/gotch/releases/download/v0.8.0/setup-gotch.sh
chmod +x setup-gotch.sh
# CUDA 10.2
export CUDA_VER=10.2 && export GOTCH_VER=v0.7.0 && bash setup-gotch.sh
# CUDA 11.3
export CUDA_VER=11.3 && export GOTCH_VER=v0.7.0 && bash setup-gotch.sh
export CUDA_VER=11.8 && export GOTCH_VER=v0.8.0 && bash setup-gotch.sh
```
## Examples