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

Audio PR - Adding support for file list reader #123

Merged
merged 272 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
272 commits
Select commit Hold shift + click to select a range
a52ae62
Introduce CMake for sndfile
fiona-gladwin Mar 13, 2024
35765e8
Merge branch 'swbs/audio/pr2' into swbs/audio/pr4
SundarRajan28 Mar 14, 2024
bb9eb8c
Adding file list reader to audio python example
SundarRajan28 Mar 14, 2024
0c5f173
Fixing reader import issue
SundarRajan28 Mar 14, 2024
2d6eaa5
Resolve 1st set of PR commenst
Mar 14, 2024
d248676
Merge remote-tracking branch 'swe_fork/swbs/audio/pr1' into swbs/audi…
Mar 14, 2024
eac59e3
Remove commented code for last batch polices and unsued imports
Mar 14, 2024
ab165ee
ROI related changes - change from xy to wh to use for samples and cha…
Mar 14, 2024
e2fe45c
Fix seg fault with ROI
Mar 14, 2024
e5ff5e4
Remove opencv usage from the unit test
Mar 14, 2024
3988643
Resolve the PR comments
Mar 14, 2024
8790f57
Remove instances of the audio_*_time - use the existing variables fro…
Mar 14, 2024
8134705
Formatting changes in rocal_api_data_loader.cpp and add the opencl an…
Mar 14, 2024
deeb04a
Updating python example
SundarRajan28 Mar 14, 2024
9d58ec6
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 14, 2024
e37bcad
Resolve the internal PR comments
Mar 14, 2024
760ba3a
Reformatting the file_source_reader.cpp
Mar 14, 2024
2534ca9
Remove _input_path from audio_source_evaluator and audio_read_and_dec…
Mar 14, 2024
73f8a31
Change the header formatting
Mar 14, 2024
585e6d5
Fixing issues with file list reader
SundarRajan28 Mar 14, 2024
6feedda
Changes in copy_data() for audio samples
Mar 14, 2024
c3babe0
Initialize the status at the beginning
Mar 14, 2024
ae68313
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
Mar 15, 2024
34d5474
Resolving review comments
SundarRajan28 Mar 15, 2024
a6d7333
Resolve PR comments
Mar 18, 2024
9b62359
Resolving PR comments
Mar 18, 2024
f7b8aee
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
Mar 18, 2024
0c6e543
Resolve PR comments
Mar 18, 2024
be1f7b7
Remove the unused variables
Mar 18, 2024
02f5249
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
SundarRajan28 Mar 18, 2024
dce8b25
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 18, 2024
d614f50
Resolve PR commensts
Mar 18, 2024
3d1bbc0
Cmake related changes for audio
Mar 18, 2024
a0c3b9e
Resolve PR comments
Mar 18, 2024
ca06049
Add condition check to eliminate any other file extensions other than…
Mar 18, 2024
006438e
Add basic testing for Audio to compare Bin files
Mar 19, 2024
9994a29
Removing storage_type from audio loader API
SundarRajan28 Mar 19, 2024
5527cc0
Update audio_read_and_decode.cpp
swetha097 Mar 19, 2024
d0139d0
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
Mar 19, 2024
40c9ef1
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 19, 2024
1a4ebc3
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
Mar 19, 2024
a308980
Update rocAL_api_audio_unittest.py
swetha097 Mar 19, 2024
7d17186
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 19, 2024
0b058bb
Revert file source reader changes
fiona-gladwin Mar 19, 2024
18a8a83
Update master_graph.cpp
swetha097 Mar 19, 2024
e5f3840
Update tensor.cpp - Remove a commented line of code
swetha097 Mar 19, 2024
6d01c41
Rephrase
Mar 19, 2024
a8507bf
Introduce ROCAL_AUDIO flag
fiona-gladwin Mar 19, 2024
421cc29
Merge branch 'swbs/audio/pr1' of https://github.com/swetha097/rocAL i…
fiona-gladwin Mar 19, 2024
ea6158b
Minor changes
fiona-gladwin Mar 19, 2024
4874e4f
Minor changes
fiona-gladwin Mar 19, 2024
75c360f
Add output comparision for Audio outputs
swetha097 Mar 19, 2024
38dc894
Merge branch 'swbs/audio/pr1' of https://github.com/swetha097/rocAL i…
swetha097 Mar 19, 2024
13ea715
Minor changes
fiona-gladwin Mar 19, 2024
95b0115
Add comment
Mar 20, 2024
033f967
Minor changes to unit test
fiona-gladwin Mar 20, 2024
f4bf553
Remove max_frames and max_channels args
fiona-gladwin Mar 20, 2024
1e6240a
Remove max_frames, max_channels and sample rate from unit test
fiona-gladwin Mar 20, 2024
dfee595
Remove the NONE types
Mar 20, 2024
7014a0c
Clean up unit test
fiona-gladwin Mar 20, 2024
dae8f53
Merge branch 'swbs/audio/pr2' of https://github.com/swetha097/rocAL i…
fiona-gladwin Mar 20, 2024
253a508
Clean up code in audio python unit test
Mar 20, 2024
c236bdf
Merge branch 'swbs/audio/pr2' of https://github.com/swetha097/rocAL i…
Mar 20, 2024
8922538
Introduce ROI in the unit test
Mar 20, 2024
d6f60ac
Minor change
fiona-gladwin Mar 20, 2024
b1624bb
Format python unit test
fiona-gladwin Mar 20, 2024
b9a39a9
Add python script to run audio unittests
swetha097 Mar 20, 2024
6018273
Merge branch 'swbs/audio/pr1' of https://github.com/swetha097/rocAL i…
swetha097 Mar 20, 2024
9b6c93a
Merge branch 'swbs/audio/pr2' of https://github.com/swetha097/rocAL i…
fiona-gladwin Mar 20, 2024
bfbbc7b
Fix formatting issues - Minor changes
Mar 20, 2024
bcc222b
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
Mar 20, 2024
08cf352
Clean up C++ audio unit test
fiona-gladwin Mar 20, 2024
9282f05
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Mar 20, 2024
4d6982a
Remove max frames and channels from decoder
fiona-gladwin Mar 20, 2024
0c3a974
Minor changes
fiona-gladwin Mar 20, 2024
ca9c74b
Add Output comparison for python audio unittests
swetha097 Mar 20, 2024
7789333
Modify rocal audio unit test
fiona-gladwin Mar 20, 2024
741a677
Minor change
fiona-gladwin Mar 20, 2024
2150bbc
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin Mar 20, 2024
e1eda57
Merge branch 'swbs/audio/pr1' of https://github.com/swetha097/rocAL i…
fiona-gladwin Mar 20, 2024
4a4cb3c
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Mar 20, 2024
582bbfb
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 20, 2024
19d26be
Merge branch 'swbs/audio/pr2' into audio_pr4
SundarRajan28 Mar 20, 2024
da8b26c
Resolve PR comments
swetha097 Mar 21, 2024
dd97798
Merge branch 'swbs/audio/pr2' of https://github.com/swetha097/rocAL i…
swetha097 Mar 21, 2024
db1bf39
Minor changes - Modifying the names of the arguments
Mar 21, 2024
fb23b54
Initial commit for removing file list reader
SundarRajan28 Mar 21, 2024
a2c6a42
Merge remote-tracking branch 'origin/swbs/audio/pr2' into swbs/audio/pr3
Mar 21, 2024
2a39822
Added a bried desc for the rocAL enum for border type
Mar 21, 2024
aaae9fa
Add a WRN statement in PreEmphasis Filter to only use FP32 dtype
Mar 21, 2024
9567eab
minor changes
swetha097 Mar 21, 2024
46b0bcc
Change the borderType enum to int32 from uint32 dtype
Mar 21, 2024
191a88d
Minor changes
fiona-gladwin Mar 21, 2024
ebb6212
Minor change
fiona-gladwin Mar 21, 2024
61ac122
Update README for audio unit test
fiona-gladwin Mar 21, 2024
79ff879
Parameters for rocALAudioIterator
Mar 21, 2024
968570e
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 21, 2024
6873d81
Merge branch 'swbs/audio/pr2' of https://github.com/swetha097/rocAL i…
swetha097 Mar 21, 2024
16403cb
Removing file list reader and metadata reader
SundarRajan28 Mar 21, 2024
6595c43
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
swetha097 Mar 21, 2024
da86d51
Minor change
fiona-gladwin Mar 21, 2024
a79d484
Remove the reset_tensor_roi() from the PreEmphasis augmentation makin…
Mar 21, 2024
c42638b
Del the Unit Test Files introduced earlier
Mar 21, 2024
4c31be2
Merge branch 'swbs/audio/pr2' into audio_pr4
SundarRajan28 Mar 22, 2024
f5e4877
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 22, 2024
ba65268
Changing python unittests for QA mode
SundarRajan28 Mar 22, 2024
e2efa14
Resolving review comments
SundarRajan28 Mar 22, 2024
7e6c498
Adding comment for file list case in file source reader
SundarRajan28 Mar 22, 2024
d5d826f
Add pre_emphasis function and gollden output comparison in audio unit…
swetha097 Mar 22, 2024
17824e4
minor change - add update val in create array
swetha097 Mar 22, 2024
db7f126
Minor variable name change
fiona-gladwin Mar 22, 2024
acffb66
minor change
swetha097 Mar 22, 2024
f887af3
Update unit test
fiona-gladwin Mar 22, 2024
03dee69
Minor change
fiona-gladwin Mar 22, 2024
df64a4a
minor change
swetha097 Mar 22, 2024
6302b4e
Merge branch 'swbs/audio/pr3' of https://github.com/swetha097/rocAL i…
swetha097 Mar 22, 2024
0404a9e
Merge branch 'swbs/audio/pr1' into swbs/audio/pr3
SundarRajan28 Mar 22, 2024
b1d11ce
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
SundarRajan28 Mar 22, 2024
45680cf
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 22, 2024
7674427
Resolving review comments
SundarRajan28 Mar 22, 2024
87ab2c3
Minor changes
fiona-gladwin Mar 22, 2024
6077ff8
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Mar 22, 2024
2da5856
Minor change
fiona-gladwin Mar 22, 2024
d5bf0d1
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
fiona-gladwin Mar 22, 2024
0455d20
Add file reader to python audio unit test
fiona-gladwin Mar 22, 2024
784f77b
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 22, 2024
e21d617
Update C++ unit test
fiona-gladwin Mar 22, 2024
b46c6f8
Update python audio unit test
fiona-gladwin Mar 22, 2024
1ed758c
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Mar 22, 2024
433857d
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
fiona-gladwin Mar 22, 2024
8f3b595
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 22, 2024
0527822
Remove the unused variable output - Resolve warnings in cpp unit test
Mar 22, 2024
41ecb2a
Remove the dst_roi arg passed to rpp
Mar 22, 2024
80907a6
Minor changes
fiona-gladwin Mar 22, 2024
f4550b2
Merge branch 'swbs/audio/pr3' of https://github.com/swetha097/rocAL i…
fiona-gladwin Mar 22, 2024
41ea790
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Mar 22, 2024
47fde8a
Adding file list reader to C++ unit tests
SundarRajan28 Mar 22, 2024
77a59ed
Fixing issues with C++ audio unit tests
SundarRajan28 Mar 22, 2024
54e802c
Resolving review comments
SundarRajan28 Mar 25, 2024
d52755e
Resolving review comments
SundarRajan28 Mar 25, 2024
d782686
Updating audio unit tests for default file list path
SundarRajan28 Mar 25, 2024
ede4508
Minor changes
fiona-gladwin Mar 25, 2024
c9a6dbb
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin Mar 26, 2024
ca6f311
Merge branch 'develop' of https://github.com/ROCm/rocAL into generic-…
fiona-gladwin Mar 26, 2024
8d34902
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin Mar 26, 2024
ffb284d
Name change from sample to data
Mar 26, 2024
ff12843
Merge branch 'generic-name-change' of https://github.com/swetha097/ro…
Mar 26, 2024
e53388f
Change from decoded_data_info to DecodedDataInfo
Mar 26, 2024
0774f69
Remove audio_decoder_factory.cpp file
fiona-gladwin Mar 26, 2024
90b9d83
Minor change
fiona-gladwin Mar 26, 2024
531e5fb
Change variable name
fiona-gladwin Mar 26, 2024
98ce527
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin Mar 26, 2024
7d4c1fd
Update the struct variable name in audio files
fiona-gladwin Mar 26, 2024
a9e6497
Minor changes
fiona-gladwin Mar 27, 2024
85d21e6
Change ROCAL_DATA_PATH to exclude rocal_data
fiona-gladwin Mar 27, 2024
6856e9b
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Mar 27, 2024
57c8a0d
Update ROCAL_DATA_PATH to exclude rocal_data
fiona-gladwin Mar 27, 2024
3a86507
Use Pascal case for function names in audio decoder
fiona-gladwin Mar 27, 2024
7f46a25
Modify cmake to have SNDFILE in all capital
fiona-gladwin Apr 2, 2024
70aa700
Minor changes
fiona-gladwin Apr 2, 2024
0693605
Add struct for audio info in AudioReadAndDecode
fiona-gladwin Apr 2, 2024
44e654d
Merge branch 'develop' of https://github.com/ROCm/rocAL into generic-…
fiona-gladwin Apr 2, 2024
c77140c
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin Apr 2, 2024
eabf7aa
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 2, 2024
f96a92b
Fix merge conflict
fiona-gladwin Apr 2, 2024
46b7e5e
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 2, 2024
91d0615
Renaming crop_image_info to CropImageInfo
swetha097 Apr 3, 2024
bb4e5a5
Remove - actual_host_buffers - Unused
swetha097 Apr 3, 2024
50829f6
Rename TimingDBG to TimingDbg
swetha097 Apr 3, 2024
d0a456b
Move the instances of DecodedDataInfo to its base class LoaderModule
swetha097 Apr 3, 2024
a80a3a6
Fix a WRN msg in master_graph.cpp
swetha097 Apr 3, 2024
f648feb
Remove a dangling comment
swetha097 Apr 3, 2024
6146bac
Rename _circ_data_info to _circ_buff_data_info
swetha097 Apr 3, 2024
47263d9
Add Glob to CMakeLists.txt
fiona-gladwin Apr 4, 2024
8623be3
Rename SndFileDecoder to GenericAudioDecoder
fiona-gladwin Apr 4, 2024
c4af22c
Merge branch 'develop' of https://github.com/ROCm/rocAL into generic-…
fiona-gladwin Apr 4, 2024
5b9be3d
Merge branch 'generic-name-change' of https://github.com/swetha097/ro…
fiona-gladwin Apr 4, 2024
47dea85
Merge branch 'generic-name-change' into swbs/audio/pr1
fiona-gladwin Apr 4, 2024
660071b
Fix build issues
fiona-gladwin Apr 4, 2024
5bd4fa8
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 4, 2024
4f9ab6b
Minor change
fiona-gladwin Apr 4, 2024
6c430cf
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 4, 2024
416180e
Update python API README.md for audio unit test
fiona-gladwin Apr 4, 2024
0f0be88
Update audio unit test README
fiona-gladwin Apr 4, 2024
3114a18
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
SundarRajan28 Apr 8, 2024
ac6e6e3
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Apr 8, 2024
e496f3a
Revert "Add Glob to CMakeLists.txt"
fiona-gladwin Apr 10, 2024
5df0055
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin Apr 10, 2024
7dc7092
Fix include headers for Audio files
fiona-gladwin Apr 10, 2024
19e30cf
Fix copy data 2D
fiona-gladwin Apr 10, 2024
34deb3b
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 10, 2024
4c02dfb
Minor changes
fiona-gladwin Apr 11, 2024
e3f350f
Pass decoded data info to load routine instead of separate vectors
fiona-gladwin Apr 11, 2024
67cda83
Update CHANGELOG.md
fiona-gladwin Apr 11, 2024
d36df07
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 11, 2024
42c844d
Update CHANGELOG.md
fiona-gladwin Apr 11, 2024
8b1c59f
Change swap_handle_time variable name in loader
fiona-gladwin Apr 11, 2024
241ce67
Merge remote-tracking branch 'swe_fork/swbs/audio/pr2' into swbs/audi…
swetha097 Apr 11, 2024
07ba1f6
Update the changelog.md
swetha097 Apr 11, 2024
abc63c9
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Apr 11, 2024
bb8908b
Update CHANGELOG.md
SundarRajan28 Apr 11, 2024
91fed39
Formatting changes
fiona-gladwin Apr 11, 2024
6a80714
Update doxygen comments
fiona-gladwin Apr 11, 2024
689985d
Move file source reader from readers/image to readers folder
fiona-gladwin Apr 11, 2024
db758fd
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 11, 2024
67190bf
Update README and add doxygen description
fiona-gladwin Apr 11, 2024
ffdcb0a
Update CMakeLists and README for audio test
fiona-gladwin Apr 11, 2024
b2de5f4
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 11, 2024
d000af0
Update README for audio test
fiona-gladwin Apr 11, 2024
7415447
Minor fix
fiona-gladwin Apr 12, 2024
f6bffef
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin Apr 12, 2024
cb034b0
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 12, 2024
d8031b5
Merge remote-tracking branch 'swe_fork/swbs/audio/pr2' into swbs/audi…
swetha097 Apr 12, 2024
d894aba
Fix merge from PR 2
swetha097 Apr 12, 2024
689c55f
Minor changes shard_count argument name
fiona-gladwin Apr 12, 2024
1079d50
Rename set and get functions of data_info to decoded_data_info
fiona-gladwin Apr 12, 2024
1f63cab
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 12, 2024
2967b68
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Apr 16, 2024
42d1bb1
Merge remote-tracking branch 'upstream/develop' into swbs/audio/pr2
SundarRajan28 Apr 17, 2024
3375f41
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
SundarRajan28 Apr 17, 2024
d7c8884
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Apr 17, 2024
d928c48
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin Apr 17, 2024
c0d2309
Merge branch 'swbs/audio/pr1' into swbs/audio/pr2
fiona-gladwin Apr 17, 2024
c01325d
Revert empty line removed in CMakeLists.txt
fiona-gladwin Apr 17, 2024
549def5
Removed prefix original for audio vectors
fiona-gladwin Apr 17, 2024
c1d9cc5
Resolve PR comments
swetha097 Apr 18, 2024
7874f09
Add @params to all args in pytorch.py
swetha097 Apr 18, 2024
0f48da9
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin Apr 22, 2024
37921de
Minor changes in unit test
swetha097 Apr 22, 2024
96ace00
Merge branch 'swbs/audio/pr2' of https://github.com/swetha097/rocAL i…
swetha097 Apr 22, 2024
6602895
Minor changes
swetha097 Apr 22, 2024
aa13a35
Change ROCAL instaces to rocAL in pytorch.py
swetha097 Apr 22, 2024
2873d8c
Merge branch 'swbs/audio/pr2' into swbs/audio/pr3
fiona-gladwin Apr 22, 2024
2dd31f8
Resolve the PR comments
swetha097 Apr 23, 2024
1cd9779
Merge branch 'swbs/audio/pr3' of https://github.com/swetha097/rocAL i…
swetha097 Apr 23, 2024
d1d5241
Minor changes in decoders.py - Modify the comment for shard_size
swetha097 Apr 23, 2024
f4bcbca
Merge branch 'swbs/audio/pr2' of https://github.com/swetha097/rocAL i…
fiona-gladwin Apr 23, 2024
d152dca
Merge branch 'swbs/audio/pr3' of https://github.com/swetha097/rocAL i…
fiona-gladwin Apr 23, 2024
e4c5788
Merge branch 'develop' of https://github.com/ROCm/rocAL into swbs/aud…
fiona-gladwin Apr 23, 2024
fb33f06
Merge branch 'swbs/audio/pr3' into audio_pr4
SundarRajan28 Apr 24, 2024
be416ef
Minor changes
swetha097 Apr 24, 2024
8a7bb3c
Address the PR comments
swetha097 Apr 25, 2024
2021ab9
Address Review comments
swetha097 Apr 25, 2024
c41f363
Merge remote-tracking branch 'open_source/develop' into swbs/audio/pr3
swetha097 May 17, 2024
70e12cd
Merge branch 'swbs/audio/pr3' into audio_pr4
swetha097 May 18, 2024
89f9f95
Resolving review comments
SundarRajan28 May 21, 2024
ceb7991
Removing file_list_path from label_reader
SundarRajan28 May 21, 2024
f45ff71
Merge remote-tracking branch 'upstream/develop' into audio_pr4
SundarRajan28 Jun 5, 2024
559a12b
Merge remote-tracking branch 'upstream/develop' into audio_pr4
SundarRajan28 Jun 6, 2024
833841b
Merge remote-tracking branch 'upstream/develop' into audio_pr4
SundarRajan28 Jun 11, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* Python audio unit test, and support to verify outputs
* rocDecode for HW decode
* Support for Audio augmentation - PreEmphasis filter
* Support for reading from file lists in file reader

### Optimizations

Expand Down
8 changes: 6 additions & 2 deletions rocAL/include/api/rocal_api_data_loaders.h
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,8 @@ extern "C" RocalTensor ROCAL_API_CALL rocalJpegExternalFileSource(RocalContext p
/*! Creates Audio file reader and decoder. It allocates the resources and objects required to read and decode audio files stored on the file systems. It has internal sharding capability to load/decode in parallel if user wants.
* If the files are not in standard audio compression formats they will be ignored, Currently wav format is supported
* \param [in] context Rocal context
* \param [in] source_path A NULL terminated char string pointing to the location of files on the disk
* \param [in] source_path A NULL terminated char string pointing to the location on the disk
* \param [in] source_file_list_path A char string pointing to the file list location on the disk
* \param [in] shard_count Defines the parallelism level by internally sharding the input dataset and load/decode using multiple decoder/loader instances. Using shard counts bigger than 1 improves the load/decode performance if compute resources (CPU cores) are available.
* \param [in] is_output Boolean variable to enable the audio to be part of the output.
* \param [in] shuffle Boolean variable to shuffle the dataset.
Expand All @@ -892,6 +893,7 @@ extern "C" RocalTensor ROCAL_API_CALL rocalJpegExternalFileSource(RocalContext p
*/
extern "C" RocalTensor ROCAL_API_CALL rocalAudioFileSource(RocalContext context,
const char* source_path,
const char* source_file_list_path,
unsigned shard_count,
bool is_output,
bool shuffle = false,
Expand All @@ -901,7 +903,8 @@ extern "C" RocalTensor ROCAL_API_CALL rocalAudioFileSource(RocalContext context,
/*! Creates Audio file reader and decoder. It allocates the resources and objects required to read and decode audio files stored on the file systems. It has internal sharding capability to load/decode in parallel is user wants.
* If the files are not in standard audio compression formats they will be ignored.
* \param [in] context Rocal context
* \param [in] source_path A NULL terminated char string pointing to the location of files on the disk
* \param [in] source_path A NULL terminated char string pointing to the location on the disk
* \param [in] source_file_list_path A char string pointing to the file list location on the disk
* \param [in] shard_id Shard id for this loader
* \param [in] shard_count Defines the parallelism level by internally sharding the input dataset and load/decode using multiple decoder/loader instances. Using shard counts bigger than 1 improves the load/decode performance if compute resources (CPU cores) are available.
* \param [in] is_output Boolean variable to enable the audio to be part of the output.
Expand All @@ -912,6 +915,7 @@ extern "C" RocalTensor ROCAL_API_CALL rocalAudioFileSource(RocalContext context,
*/
extern "C" RocalTensor ROCAL_API_CALL rocalAudioFileSourceSingleShard(RocalContext p_context,
const char* source_path,
const char* source_file_list_path,
unsigned shard_id,
unsigned shard_count,
bool is_output,
Expand Down
3 changes: 2 additions & 1 deletion rocAL/include/api/rocal_api_meta_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ THE SOFTWARE.
* \ingroup group_rocal_meta_data
* \param [in] rocal_context rocal context
* \param [in] source_path path to the folder that contains the dataset or metadata file
* \param file_list_path is the path to file list that contains the file names and its corresponding labels
* \return RocalMetaData object, can be used to inquire about the rocal's output (processed) tensors
*/
extern "C" RocalMetaData ROCAL_API_CALL rocalCreateLabelReader(RocalContext rocal_context, const char* source_path);
extern "C" RocalMetaData ROCAL_API_CALL rocalCreateLabelReader(RocalContext rocal_context, const char* source_path, const char* file_list_path = "");

/*! \brief creates video label reader
* \ingroup group_rocal_meta_data
Expand Down
1 change: 1 addition & 0 deletions rocAL/include/readers/file_source_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class FileSourceReader : public Reader {
Reader::Status open_folder();
Reader::Status subfolder_reading();
std::string _folder_path;
std::string _file_list_path;
DIR *_src_dir;
DIR *_sub_dir;
struct dirent *_entity;
Expand Down
5 changes: 4 additions & 1 deletion rocAL/include/readers/image/image_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ struct ReaderConfig {
std::map<std::string, std::string> feature_key_map() { return _feature_key_map; }
void set_file_prefix(const std::string &prefix) { _file_prefix = prefix; }
std::string file_prefix() { return _file_prefix; }
void set_file_list_path(const std::string &file_list_path) { _file_list_path = file_list_path; }
std::string file_list_path() { return _file_list_path; }
std::shared_ptr<MetaDataReader> meta_data_reader() { return _meta_data_reader; }
ExternalSourceFileMode mode() { return _file_mode; }
std::pair<RocalBatchPolicy, bool> get_last_batch_policy() { return _last_batch_info; }
Expand All @@ -117,7 +119,8 @@ struct ReaderConfig {
size_t _sequence_frame_stride = 1;
bool _shuffle = false;
bool _loop = false;
std::string _file_prefix = ""; //!< to read only files with prefix. supported only for cifar10_data_reader and tf_record_reader
std::string _file_prefix; //!< to read only files with prefix. supported only for cifar10_data_reader and tf_record_reader
std::string _file_list_path; //!< to read only files present in the file list
std::shared_ptr<MetaDataReader> _meta_data_reader = nullptr;
ExternalSourceFileMode _file_mode = ExternalSourceFileMode::NONE;
std::pair<RocalBatchPolicy, bool> _last_batch_info = {RocalBatchPolicy::FILL, true};
Expand Down
10 changes: 7 additions & 3 deletions rocAL/source/api/rocal_api_data_loaders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ std::tuple<unsigned, unsigned>
evaluate_audio_data_set(StorageType storage_type, DecoderType decoder_type,
const std::string& source_path, const std::string& file_list_path) {
AudioSourceEvaluator source_evaluator;
if (source_evaluator.Create(ReaderConfig(storage_type, source_path, file_list_path), DecoderConfig(decoder_type)) != AudioSourceEvaluatorStatus::OK)
auto reader_config = ReaderConfig(storage_type, source_path);
reader_config.set_file_list_path(file_list_path);
if (source_evaluator.Create(reader_config, DecoderConfig(decoder_type)) != AudioSourceEvaluatorStatus::OK)
THROW("Initializing file source input evaluator failed")
auto max_samples = source_evaluator.GetMaxSamples();
auto max_channels = source_evaluator.GetMaxChannels();
Expand Down Expand Up @@ -2189,6 +2191,7 @@ RocalTensor ROCAL_API_CALL
rocalAudioFileSourceSingleShard(
RocalContext p_context,
const char* source_path,
const char* source_file_list_path,
unsigned shard_id,
unsigned shard_count,
bool is_output,
Expand All @@ -2203,7 +2206,7 @@ rocalAudioFileSourceSingleShard(
THROW("Shard count should be bigger than 0")
if (shard_id >= shard_count)
THROW("Shard id should be smaller than shard count")
auto [max_sample_length, max_channels] = evaluate_audio_data_set(StorageType::FILE_SYSTEM, DecoderType::AUDIO_SOFTWARE_DECODE, source_path, "");
auto [max_sample_length, max_channels] = evaluate_audio_data_set(StorageType::FILE_SYSTEM, DecoderType::AUDIO_SOFTWARE_DECODE, source_path, source_file_list_path);
INFO("Internal buffer size for audio samples = " + TOSTR(max_sample_length) + " and channels = " + TOSTR(max_channels))
RocalTensorDataType tensor_data_type = RocalTensorDataType::FP32;
std::vector<size_t> dims = {context->user_batch_size(), max_sample_length, max_channels};
Expand Down Expand Up @@ -2234,6 +2237,7 @@ RocalTensor ROCAL_API_CALL
rocalAudioFileSource(
RocalContext p_context,
const char* source_path,
const char* source_file_list_path,
unsigned shard_count,
bool is_output,
bool shuffle,
Expand All @@ -2243,7 +2247,7 @@ rocalAudioFileSource(
auto context = static_cast<Context*>(p_context);
try {
#ifdef ROCAL_AUDIO
auto [max_sample_length, max_channels] = evaluate_audio_data_set(StorageType::FILE_SYSTEM, DecoderType::AUDIO_SOFTWARE_DECODE, source_path, "");
auto [max_sample_length, max_channels] = evaluate_audio_data_set(StorageType::FILE_SYSTEM, DecoderType::AUDIO_SOFTWARE_DECODE, source_path, source_file_list_path);
INFO("Internal buffer size for audio samples = " + TOSTR(max_sample_length) + " and channels = " + TOSTR(max_channels))
RocalTensorDataType tensor_data_type = RocalTensorDataType::FP32;
std::vector<size_t> dims = {context->user_batch_size(), max_sample_length, max_channels};
Expand Down
8 changes: 5 additions & 3 deletions rocAL/source/api/rocal_api_meta_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,14 @@ void

RocalMetaData
ROCAL_API_CALL
rocalCreateLabelReader(RocalContext p_context, const char* source_path) {
rocalCreateLabelReader(RocalContext p_context, const char* source_path, const char* file_list_path) {
if (!p_context)
THROW("Invalid rocal context passed to rocalCreateLabelReader")
auto context = static_cast<Context*>(p_context);

return context->master_graph->create_label_reader(source_path, MetaDataReaderType::FOLDER_BASED_LABEL_READER);
if (strlen(file_list_path) == 0)
Copy link
Contributor

@rrawther rrawther Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this for checking empty string. please use is_empty() instead.
Why can't the caller to this api pass single path (source_path or file_list) depending on the use case so it is not required to change here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source path is passed as const char array so strlen is used here
We are creating different metadata readers depending on whether file_list_path is passed or not so both are needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, check if file_list_path == nullptr ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both source_path and file_list_path have default values of "" so nullptr checks won't work for them

return context->master_graph->create_label_reader(source_path, MetaDataReaderType::FOLDER_BASED_LABEL_READER);
else
return context->master_graph->create_label_reader(file_list_path, MetaDataReaderType::TEXT_FILE_META_DATA_READER);
}

RocalMetaData
Expand Down
1 change: 1 addition & 0 deletions rocAL/source/loaders/audio/node_audio_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ void AudioLoaderNode::Init(unsigned internal_shard_count, unsigned cpu_num_threa
reader_cfg.set_batch_count(load_batch_count);
reader_cfg.set_meta_data_reader(meta_data_reader);
reader_cfg.set_cpu_num_threads(cpu_num_threads);
reader_cfg.set_file_list_path(file_list_path);
_loader_module->initialize(reader_cfg, DecoderConfig(decoder_type), mem_type, _batch_size, false);
_loader_module->start_loading();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ void AudioLoaderSingleShardNode::Init(unsigned shard_id, unsigned shard_count, u
reader_cfg.set_batch_count(load_batch_count);
reader_cfg.set_meta_data_reader(meta_data_reader);
reader_cfg.set_cpu_num_threads(cpu_num_threads);
reader_cfg.set_file_list_path(file_list_path);
_loader_module->initialize(reader_cfg, DecoderConfig(decoder_type), mem_type, _batch_size);
_loader_module->start_loading();
}
Expand Down
13 changes: 9 additions & 4 deletions rocAL/source/meta_data/text_file_meta_data_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,20 @@ void TextFileMetaDataReader::lookup(const std::vector<std::string> &image_names)
void TextFileMetaDataReader::read_all(const std::string &path) {
std::ifstream text_file(path.c_str());
if (text_file.good()) {
//_text_file.open(path.c_str(), std::ifstream::in);
std::string line;
while (std::getline(text_file, line)) {
std::istringstream line_ss(line);
int label;
std::string image_name;
if (!(line_ss >> image_name >> label))
std::string file_name;
if (!(line_ss >> file_name >> label))
continue;
add(image_name, label);
// process pair (file_name, label)
auto last_id = file_name;
auto last_slash_idx = last_id.find_last_of("\\/");
if (std::string::npos != last_slash_idx) {
last_id.erase(0, last_slash_idx + 1);
}
add(last_id, label);
}
} else {
THROW("Can't open the metadata file at " + path)
Expand Down
3 changes: 2 additions & 1 deletion rocAL/source/pipeline/master_graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,8 @@ std::vector<rocalTensorList *> MasterGraph::create_label_reader(const char *sour
THROW("A metadata reader has already been created")
if (_augmented_meta_data)
THROW("Metadata can only have a single output")

if (strlen(source_path) == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (strlen(source_path) == 0)
if (strlen(source_path) == 0)

use is_empty instead

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The source path is passed as const char array so strlen is used here

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't you check for nullptr in that case?

THROW("Source path needs to be provided")
MetaDataConfig config(MetaDataType::Label, reader_type, source_path);
_meta_data_reader = create_meta_data_reader(config, _augmented_meta_data);
_meta_data_reader->read_all(source_path);
Expand Down
74 changes: 56 additions & 18 deletions rocAL/source/readers/file_source_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Reader::Status FileSourceReader::initialize(ReaderConfig desc) {
auto ret = Reader::Status::OK;
_file_id = 0;
_folder_path = desc.path();
_file_list_path = desc.file_list_path();
_shard_id = desc.get_shard_id();
_shard_count = desc.get_shard_count();
_batch_count = desc.get_batch_size();
Expand Down Expand Up @@ -161,25 +162,62 @@ Reader::Status FileSourceReader::generate_file_names() {
std::sort(entry_name_list.begin(), entry_name_list.end());

auto ret = Reader::Status::OK;
for (unsigned dir_count = 0; dir_count < entry_name_list.size(); ++dir_count) {
std::string subfolder_path = _full_path + "/" + entry_name_list[dir_count];
filesys::path pathObj(subfolder_path);
if (filesys::exists(pathObj) && filesys::is_regular_file(pathObj)) {
// ignore files with unsupported extensions
auto file_extension_idx = subfolder_path.find_last_of(".");
if (file_extension_idx != std::string::npos) {
std::string file_extension = subfolder_path.substr(file_extension_idx + 1);
std::transform(file_extension.begin(), file_extension.end(), file_extension.begin(),
[](unsigned char c) { return std::tolower(c); });
if ((file_extension != "jpg") && (file_extension != "jpeg") && (file_extension != "png") && (file_extension != "ppm") && (file_extension != "bmp") && (file_extension != "pgm") && (file_extension != "tif") && (file_extension != "tiff") && (file_extension != "webp") && (file_extension != "wav"))
continue;
if (!_file_list_path.empty()) { // Reads the file paths from the file list and adds to file_names vector for decoding
std::ifstream fp(_file_list_path);
if (fp.is_open()) {
while (fp) {
rrawther marked this conversation as resolved.
Show resolved Hide resolved
std::string file_label_path;
std::getline(fp, file_label_path);
std::istringstream ss(file_label_path);
std::string file_path;
std::getline(ss, file_path, ' ');
if (filesys::path(file_path).is_relative()) { // Only add root path if the file list contains relative file paths
if (!filesys::exists(_folder_path))
THROW("File list contains relative paths but root path doesn't exists");
file_path = _folder_path + "/" + file_path;
}
std::string file_name = file_path.substr(file_path.find_last_of("/\\") + 1);

if (!_meta_data_reader || _meta_data_reader->exists(file_name)) { // Check if the file is present in metadata reader and add to file names list, to avoid issues while lookup
if (filesys::is_regular_file(file_path)) {
if (get_file_shard_id() != _shard_id) {
_file_count_all_shards++;
incremenet_file_id();
continue;
}
_in_batch_read_count++;
_in_batch_read_count = (_in_batch_read_count % _batch_count == 0) ? 0 : _in_batch_read_count;
_last_file_name = file_path;
_file_names.push_back(file_path);
_file_count_all_shards++;
incremenet_file_id();
}
} else {
WRN("Skipping file," + std::string(file_path) + " as it is not present in metadata reader")
}
}
}
} else {
for (unsigned dir_count = 0; dir_count < entry_name_list.size(); ++dir_count) {
std::string subfolder_path = _full_path + "/" + entry_name_list[dir_count];
filesys::path pathObj(subfolder_path);
if (filesys::exists(pathObj) && filesys::is_regular_file(pathObj)) {
// ignore files with unsupported extensions
auto file_extension_idx = subfolder_path.find_last_of(".");
if (file_extension_idx != std::string::npos) {
std::string file_extension = subfolder_path.substr(file_extension_idx + 1);
std::transform(file_extension.begin(), file_extension.end(), file_extension.begin(),
[](unsigned char c) { return std::tolower(c); });
if ((file_extension != "jpg") && (file_extension != "jpeg") && (file_extension != "png") && (file_extension != "ppm") && (file_extension != "bmp") && (file_extension != "pgm") && (file_extension != "tif") && (file_extension != "tiff") && (file_extension != "webp") && (file_extension != "wav"))
continue;
}
ret = open_folder();
break; // assume directory has only files.
} else if (filesys::exists(pathObj) && filesys::is_directory(pathObj)) {
_folder_path = subfolder_path;
if (open_folder() != Reader::Status::OK)
WRN("FileReader ShardID [" + TOSTR(_shard_id) + "] File reader cannot access the storage at " + _folder_path);
}
ret = open_folder();
break; // assume directory has only files.
} else if (filesys::exists(pathObj) && filesys::is_directory(pathObj)) {
_folder_path = subfolder_path;
if (open_folder() != Reader::Status::OK)
WRN("FileReader ShardID [" + TOSTR(_shard_id) + "] File reader cannot access the storage at " + _folder_path);
}
}

Expand Down
1 change: 1 addition & 0 deletions rocAL_pybind/amd/rocal/decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ def audio(*inputs, file_root='', file_list_path='', shard_id=0, num_shards=1, ra
"""
kwargs_pybind = {
"source_path": file_root,
"source_file_list_path": file_list_path,
"shard_id": shard_id,
"num_shards": num_shards,
"is_output": False,
Expand Down
2 changes: 2 additions & 0 deletions rocAL_pybind/amd/rocal/plugin/pytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,8 @@ def __next__(self):
self.output_tensor_list[i].copy_data(ctypes.c_void_p(output.data_ptr()), self.output_memory_type)
self.output_list.append(output)

self.labels = self.loader.get_image_labels()
self.labels_tensor = self.labels_tensor.copy_(torch.from_numpy(self.labels)).long()
return self.output_list, self.labels_tensor, torch.tensor(self.roi_array.reshape(self.batch_size,4)[...,2:4])

def reset(self):
Expand Down
2 changes: 1 addition & 1 deletion rocAL_pybind/amd/rocal/readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def file(file_root, file_filters=None, file_list='', stick_to_shard=False, pad_l
Pipeline._current_pipeline._reader = "labelReader"
# Output
labels = []
kwargs_pybind = {"source_path": file_root}
kwargs_pybind = {"source_path": file_root, "file_list": file_list}
rrawther marked this conversation as resolved.
Show resolved Hide resolved
label_reader_meta_data = b.labelReader(
Pipeline._current_pipeline._handle, *(kwargs_pybind.values()))
return (label_reader_meta_data, labels)
Expand Down
Loading