Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update v2.0-pre #953

Merged
merged 65 commits into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
9ac1e78
Update doc URL. (#821)
csukuangfj Sep 8, 2021
bbe0ded
Support indexing 2-axes RaggedTensor, Support slicing for RaggedTenso…
pkufool Sep 14, 2021
2c28070
Prune with max_arcs in IntersectDense (#820)
pkufool Sep 14, 2021
210175c
Release v1.8
pkufool Sep 14, 2021
33a212c
Create a ragged tensor from a regular tensor. (#827)
csukuangfj Sep 15, 2021
971af7d
Trigger GitHub actions manually. (#829)
csukuangfj Sep 16, 2021
646704e
Run GitHub actions on merging. (#830)
csukuangfj Sep 16, 2021
8030001
Support printing ragged tensors in a more compact way. (#831)
csukuangfj Sep 17, 2021
d73a5b5
Add levenshtein alignment (#828)
pkufool Sep 19, 2021
f2fd997
Release v1.9
pkufool Sep 19, 2021
601d663
Support a[b[i]] where both a and b are ragged tensors. (#833)
csukuangfj Sep 25, 2021
8694fee
Display import error solution message on MacOS (#837)
pzelasko Sep 30, 2021
86e5479
Fix installation doc. (#841)
csukuangfj Oct 8, 2021
b72589c
fix typos in the install instructions (#844)
jtrmal Oct 13, 2021
6ac9795
make cmake adhere to the modernized way of finding packages outside d…
jtrmal Oct 13, 2021
2537a3f
import torch first in the smoke tests to preven SEGFAULT (#846)
jtrmal Oct 14, 2021
cae610a
Add doc about how to install a CPU version of k2. (#850)
csukuangfj Oct 23, 2021
d061bc6
Support PyTorch 1.10. (#851)
csukuangfj Oct 24, 2021
7178d67
Fix test cases for k2.union() (#853)
csukuangfj Oct 26, 2021
e6db5dc
Fix out-of-boundary access (read). (#859)
csukuangfj Nov 2, 2021
e8c589a
Update all the example codes in the docs (#861)
luomingshuang Nov 4, 2021
fd5565d
Fix compilation errors with CUB 1.15. (#865)
csukuangfj Nov 10, 2021
bdcaaf8
Update README. (#873)
csukuangfj Nov 12, 2021
31e1307
Fix ctc graph (make aux_labels of final arcs -1) (#877)
pkufool Nov 19, 2021
12f5915
Fix LICENSE location to k2 folder (#880)
lumaku Nov 24, 2021
a0d75c8
Release v1.11. (#881)
csukuangfj Nov 29, 2021
2cb3eea
Update documentation for hash.h (#887)
danpovey Dec 5, 2021
aab2dd7
Wrap MonotonicLowerBound (#883)
pkufool Dec 14, 2021
5517b3e
Remove extra commas after 'TOPSORTED' properity and fix RaggedTensor …
drawfish Dec 25, 2021
5f4cc79
Fix small typos (#896)
danpovey Jan 6, 2022
e799928
Fix k2.ragged.create_ragged_shape2 (#901)
csukuangfj Jan 13, 2022
d6323d5
Add rnnt loss (#891)
pkufool Jan 17, 2022
d3fbb1b
Use more efficient way to fix boundaries (#906)
pkufool Jan 25, 2022
9a91ec6
Release v1.12 (#907)
pkufool Jan 25, 2022
3367c7f
Change the sign of the rnnt_loss and add reduction argument (#911)
pkufool Jan 29, 2022
779a9bd
Fix building doc. (#908)
csukuangfj Jan 29, 2022
47c4b75
Fix building doc (#912)
pkufool Jan 29, 2022
cf32e2d
Support torch 1.10.x (#914)
csukuangfj Feb 8, 2022
9e7b2a9
Update INSTALL.rst (#915)
alexei-v-ivanov Feb 8, 2022
43ed450
Fix torch/cuda/python versions in the doc. (#918)
csukuangfj Feb 10, 2022
f4fefe4
Fix building for CUDA 11.6 (#917)
csukuangfj Feb 10, 2022
56edc82
Implement Unstack (#920)
pkufool Feb 20, 2022
854b792
SubsetRagged & PruneRagged (#919)
pkufool Feb 20, 2022
3cc74f1
Add Hash64 (#895)
pkufool Feb 22, 2022
0feefc7
Modified rnnt (#902)
pkufool Feb 25, 2022
2239c39
Fix Stack (#925)
wgb14 Feb 25, 2022
5ee082e
Fix 'TypeError' of rnnt_loss_pruned function. (#924)
drawfish Feb 27, 2022
36e2b8d
Support torch 1.11.0 and CUDA 11.5 (#931)
csukuangfj Mar 15, 2022
f4b4247
Implement Rnnt decoding (#926)
pkufool Mar 16, 2022
9a0d72c
fix building docs (#933)
pkufool Mar 16, 2022
6833270
Release v1.14
pkufool Mar 16, 2022
613e03d
Remove unused DiscountedCumSum. (#936)
csukuangfj Mar 17, 2022
281378f
Fix compiler warnings. (#937)
csukuangfj Mar 17, 2022
10b9423
Minor fixes for RNN-T decoding. (#938)
csukuangfj Mar 19, 2022
846c39c
Removes arcs with label 0 from the TrivialGraph. (#939)
csukuangfj Mar 29, 2022
0f65420
Implement linear_fsa_with_self_loops. (#940)
csukuangfj Mar 29, 2022
a830c60
Fix the pruning with max-states (#941)
pkufool Mar 30, 2022
8c28c86
Rnnt allow different encoder/decoder dims (#945)
danpovey Apr 3, 2022
d977865
Supporting building k2 on Windows (#946)
csukuangfj Apr 6, 2022
a4d76d2
Fix nightly windows CPU build (#948)
csukuangfj Apr 7, 2022
4fb6b88
Check the versions of PyTorch and CUDA at the import time. (#949)
csukuangfj Apr 8, 2022
9ebd757
More straightforward message when CUDA support is missing (#950)
nshmyrev Apr 11, 2022
3b83183
Implement ArrayOfRagged (#927)
LvHang Apr 12, 2022
1b29f0a
Fix precision (#951)
pkufool Apr 13, 2022
93d528a
Merge branch 'master' into v2.0
pkufool Apr 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Check the versions of PyTorch and CUDA at the import time. (#949)
* Check the versions of PyTorch and CUDA at the import time.
  • Loading branch information
csukuangfj authored Apr 8, 2022
commit 4fb6b88661cca73e5f66f03df16e5a1d0c4886f8
1 change: 1 addition & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exclude =
get_version.py
build,
k2/python/host,
k2/python/k2/__init__.py,
k2/python/k2/ctc_loss.py,
docs

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
k2/python/k2/torch_version.py
# Build folder
**/build*

Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ if(K2_USE_PYTORCH)
add_definitions(-DK2_USE_PYTORCH)
add_definitions(-DTORCH_API_INCLUDE_EXTENSION_H)
include(torch)
configure_file(
${CMAKE_SOURCE_DIR}/k2/python/k2/torch_version.py.in
${CMAKE_SOURCE_DIR}/k2/python/k2/torch_version.py @ONLY
)
endif()

if(K2_WITH_CUDA)
Expand Down
21 changes: 21 additions & 0 deletions k2/python/k2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
import torch # noqa
from .torch_version import k2_torch_cuda_version
from .torch_version import k2_torch_version

if torch.__version__.split("+")[0] != k2_torch_version.split("+")[0]:
raise ImportError(
f"k2 was built using PyTorch {k2_torch_version}\n"
f"But you are using PyTorch {torch.__version__} to run it"
)

if (
k2_torch_cuda_version != ""
and torch.version.cuda is not None
and torch.version.cuda != k2_torch_cuda_version
):
raise ImportError(
f"k2 was built using CUDA {k2_torch_cuda_version}\n"
f"But you are using CUDA {torch.version.cuda} to run it."
)

try:
from _k2 import DeterminizeWeightPushingType
from _k2 import simple_ragged_index_select
except ImportError as e:
import sys

major_v, minor_v = sys.version_info[:2]
raise ImportError(
str(e) + "\nNote: If you're using anaconda and importing k2 on MacOS,"
Expand All @@ -18,6 +38,7 @@
from . import dense_fsa_vec
from . import fsa
from . import utils

#
from .autograd import intersect_dense
from .autograd import intersect_dense_pruned
Expand Down
17 changes: 17 additions & 0 deletions k2/python/k2/torch_version.py.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Auto generated by the toplevel CMakeLists.txt.
#
# DO NOT EDIT.

# The torch version used to build k2. We will check it against the torch version
# that is used to run k2. If they are not the same, `import k2` will throw.
#
# Some example values are:
# - 1.10.0+cu102
# - 1.5.0+cpu
k2_torch_version = "@TORCH_VERSION@"

# The CUDA version used to build k2.
# Note: It is an empty string if you used a CPU version of PyTorch to build k2
#
# An example value is "10.2".
k2_torch_cuda_version = "@TORCH_CUDA_VERSION@"