Skip to content

Commit

Permalink
Improvements via t12n
Browse files Browse the repository at this point in the history
There's some ongoing activity trying to repurpose the models for
transliteration. Since the models are small, and the authors can
eventually end up using them in their day-to-day life since
transliteration is viable to have around (in comparison to translation).

The following improvements are added:

1. Allow a non-shortlist path
2. Add `nano` config to put in t12n models. This is subject to change
during the course of experimentation.
3. Test-suite reading traces from `marian-dev` and generating unit-tests
using a Python script (rudimentary, can improve over the course of
development).
4. The following bugfixes
   a. LayerNorm fixed by adjusting default EPS `1e-9` to `1e-6`
b. Fix `limit_factor()` narrowed into `size_t` due to mistyping; longer
sequences should come now.
c. Fix initialization for greedy decode (was not offset correctly
before).

**Known Issues**

1. `HighwayForward` error at 1e-6 (1e-7 EPS fails), not satisfactory.
Abstract operation to be unit-testable.
2. There are still mismatches in the forward--pass to sort out.

Pull Request: #47
  • Loading branch information
jerinphilip authored Jan 22, 2024
1 parent 3b392f1 commit c20abc9
Show file tree
Hide file tree
Showing 32 changed files with 695 additions and 991 deletions.
34 changes: 34 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
{
"configurations": [
{
"name": "(gdb) t12n",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/env/bin/python3",
"args": [
"${workspaceFolder}/scripts/t12n.py",
"${workspaceFolder}/../slimt-t12n/outputs/mal-eng/model.nano.npz.decoder.yml",
"<",
"${workspaceFolder}/data/ml-xlit.txt"
],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
},
{
"description": "Enable following into child for debugging.",
"text": "set follow-fork-mode child",
"ignoreFailures": true
}
]
},
{
"name": "(gdb) test",
"type": "cppdbg",
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ option(BUILD_STATIC "Build static libraries" ON)
option(SLIMT_PACKAGE "Package for cmake, pkgconfig" OFF)
option(SLIMT_PYTHON_LINK_STATIC
"link-method to produce python package (static/shared)" ON)
option(SLIMT_GENERATED_UNIT_TESTS "Generate unit tests to run using Python" OFF)

include(MacroEnsureOutOfSourceBuild)
macro_ensure_out_of_source_build(
Expand Down Expand Up @@ -208,6 +209,7 @@ endif(UNIX)

add_subdirectory(slimt)
add_subdirectory(app)
add_subdirectory(tests)

if(BUILD_PYTHON)
if(USE_PYBIND11_SOURCE)
Expand Down
4 changes: 0 additions & 4 deletions app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ add_executable(slimt_cli main.cc)
set_target_properties(slimt_cli PROPERTIES OUTPUT_NAME "slimt-cli")
target_link_libraries(slimt_cli PUBLIC slimt)

add_executable(slimt_test test.cc)
set_target_properties(slimt_test PROPERTIES OUTPUT_NAME "slimt-test")
target_link_libraries(slimt_test PUBLIC slimt)

set(SLIMT_BINARIES slimt_cli)

if(UNIX)
Expand Down
Loading

0 comments on commit c20abc9

Please sign in to comment.