clab / clab/dynet

Parameter with batch dimension >1 results in runtime error when forward() is called

Open
#1,554 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
3.4k
Forks
701
PR merge metrics
No merged PRs in 30d

Description

A Parameter with batch dimension > 1 can be added to a ParameterCollection.
Calling forward() with Expressions that can be traced back to such Parameters results in a runtime error.

>libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Node parameters({8,2X4}) @ 0x7f8c99f001b8 does not support batching but got fed batched tensor
Abort trap: 6

Here is a minimal example.
[batched_param.txt](https://github.com/clab/dynet/files/3196873/batched_param.txt)

Batched Parameters seems to be allowed in older versions (I checked with 51b528c) of DyNet.
I suspect that the behavior has changed since #1493 but have not verified it.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the runtime error with the attached batched_param.txt example and trace the forward() path for Expressions derived from batched Parameters in a ParameterCollection. Compare the behavior with commit 51b528c and investigate the suspected change associated with #1493. Done means batched Parameters with dimension greater than 1 can be used by forward() without the reported batching error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.