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

to-file stage failure #14

Closed
pdmack opened this issue Apr 22, 2022 · 6 comments · Fixed by #15
Closed

to-file stage failure #14

pdmack opened this issue Apr 22, 2022 · 6 comments · Fixed by #15

Comments

@pdmack
Copy link
Contributor

pdmack commented Apr 22, 2022

Traceback (most recent call last):
  File "/opt/conda/envs/morpheus/bin/morpheus", line 11, in <module>
    sys.exit(run_cli())
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/cli.py", line 1381, in run_cli
    cli(obj={}, auto_envvar_prefix='CLX', show_default=True, prog_name="morpheus")
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/click/core.py", line 1689, in invoke
    return _process_result(rv)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/click/core.py", line 1626, in _process_result
    value = ctx.invoke(self._result_callback, value, **ctx.params)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/cli.py", line 543, in post_pipeline
    pipeline.run()
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 1239, in run
    asyncio.run(self._do_run())
  File "/opt/conda/envs/morpheus/lib/python3.8/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/opt/conda/envs/morpheus/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 1214, in _do_run
    self.build_and_start()
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 1038, in build_and_start
    self.start()
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 998, in start
    self._neo_executor.start()
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 960, in inner_build
    s.build(seg)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 526, in build
    dep.build(seg, do_propagate=do_propagate)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 526, in build
    dep.build(seg, do_propagate=do_propagate)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 526, in build
    dep.build(seg, do_propagate=do_propagate)
  [Previous line repeated 10 more times]
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 504, in build
    out_ports_pair = self._build(seg, in_ports_pairs)
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/pipeline.py", line 783, in _build
    return [self._build_single(seg, in_ports_streams[0])]
  File "/opt/conda/envs/morpheus/lib/python3.8/site-packages/morpheus/pipeline/output/to_file.py", line 113, in _build_single
    to_file = neos.WriteToFileStage(seg,
ValueError: Read/Write mode ('+') is not supported by WriteToFileStage. Mode: w+
@mdemoret-nv
Copy link
Contributor

Do you have a repro script?

@cwharris
Copy link
Contributor

WriteToFileStage supports w (write, truncate) and a (write, append) modes, but not w+ (read/write truncate). Are you providing the mode explicitly? If so, just change the mode to w, since WriteToFileStage doesn't need to read. If not, how are you producing this error, and what is the expected result?

@pdmack
Copy link
Contributor Author

pdmack commented Apr 23, 2022

This is simply using the to-file stage like this:

morpheus run --use_cpp=True --num_threads=8 --pipeline_batch_size=8192 --model_max_batch_size=32 --edge_buffer_size=32  pipeline-nlp --model_seq_length=256 from-file --filename=./data/pcap_dump.jsonlines dropna monitor --description='Drop Null Attributes rate' deserialize monitor --description='Deserialization rate' preprocess --vocab_hash_file=./data/bert-base-uncased-hash.txt --truncation=True --do_lower_case=True --add_special_tokens=False monitor --description='Preprocessing rate' inf-triton --force_convert_inputs=True --model_name=sid-minibert-onnx --server_url=ai-engine:8001 --use_shared_memory=True monitor --description='Inference rate' --smoothing=0.001 --unit inf add-class monitor --description='Classification rate' serialize --exclude '^ts_' monitor --description='Serialization rate' to-file --filename=/common/data/output/sid-minibert-onnx-output.jsonlines --overwrite

there are no arguments that relate to modes save --overwrite I suppose.

@pdmack
Copy link
Contributor Author

pdmack commented Apr 23, 2022

@pdmack
Copy link
Contributor Author

pdmack commented Apr 23, 2022

Works if I drop the --overwrite arg

@cwharris
Copy link
Contributor

What should happen to the output file if the overwrite flag is not provided? Should it be appended to, or should the write fail? Something else?

rapids-bot bot pushed a commit that referenced this issue Aug 2, 2023
I have a few changes here. Some of them might not make it depending on how others feel.

- Move test utilities in to a library to share across tests.
- Move tests in to individual executable to enforce individual tests to not sharing code.
- Use `gtest_discover_tests` to let `ctest` run and show all tests individually.
- Use `gtest::gtest_main` and remove explicit main entry file.
- ~Build and run tests by default.~
- Ability to filter tests by `ctest --test-dir build -R "TestCuda.*"`

```
+ echo 'Running CTest...'
Running CTest...
+ ctest --test-dir build
Internal ctest changing into directory: /workspaces/morpheus/build
Test project /workspaces/morpheus/build
      Start  1: TestCuda.LargeShape
 1/35 Test  #1: TestCuda.LargeShape .......................................   Passed    0.17 sec
      Start  2: TestDataLoader.DataLoaderInitializationTest
 2/35 Test  #2: TestDataLoader.DataLoaderInitializationTest ...............   Passed    0.07 sec
      Start  3: TestDataLoader.DataLoaderRegisterLoaderTest
 3/35 Test  #3: TestDataLoader.DataLoaderRegisterLoaderTest ...............   Passed    0.07 sec
      Start  4: TestDataLoader.DataLoaderRemoveLoaderTest
 4/35 Test  #4: TestDataLoader.DataLoaderRemoveLoaderTest .................   Passed    0.07 sec
      Start  5: TestDataLoader.PayloadLoaderTest
 5/35 Test  #5: TestDataLoader.PayloadLoaderTest ..........................   Passed    1.42 sec
      Start  6: TestDataLoader.FileLoaderTest
 6/35 Test  #6: TestDataLoader.FileLoaderTest .............................   Passed    2.65 sec
      Start  7: TestControlMessage.InitializationTest
 7/35 Test  #7: TestControlMessage.InitializationTest .....................   Passed    0.07 sec
      Start  8: TestControlMessage.SetMessageTest
 8/35 Test  #8: TestControlMessage.SetMessageTest .........................   Passed    0.07 sec
      Start  9: TestControlMessage.TaskTest
 9/35 Test  #9: TestControlMessage.TaskTest ...............................   Passed    0.07 sec
      Start 10: TestControlMessage.PayloadTest
10/35 Test #10: TestControlMessage.PayloadTest ............................   Passed    1.45 sec
      Start 11: TestDataLoaderModule.DataLoaderModuleInitializationTest
11/35 Test #11: TestDataLoaderModule.DataLoaderModuleInitializationTest ...   Passed    0.07 sec
      Start 12: TestDataLoaderModule.EndToEndPayloadDataLoaderTest
12/35 Test #12: TestDataLoaderModule.EndToEndPayloadDataLoaderTest ........   Passed    0.12 sec
      Start 13: TestDeserializers.GetIndexColCountNoIdxFromFile
13/35 Test #13: TestDeserializers.GetIndexColCountNoIdxFromFile ...........   Passed    1.39 sec
      Start 14: TestDeserializers.GetIndexColCountWithIdxFromFile
14/35 Test #14: TestDeserializers.GetIndexColCountWithIdxFromFile .........   Passed    1.37 sec
      Start 15: TestDeserializers.GetIndexColCountNoIdxSimilarName
15/35 Test #15: TestDeserializers.GetIndexColCountNoIdxSimilarName ........   Passed    0.19 sec
      Start 16: TestDeserializers.GetIndexColCountIdx
16/35 Test #16: TestDeserializers.GetIndexColCountIdx .....................   Passed    0.18 sec
      Start 17: TestDeserializers.GetIndexColCountValidNameInvalidType
17/35 Test #17: TestDeserializers.GetIndexColCountValidNameInvalidType ....   Passed    0.16 sec
      Start 18: TestDevMemInfo.RmmBufferConstructor
18/35 Test #18: TestDevMemInfo.RmmBufferConstructor .......................   Passed    0.16 sec
      Start 19: TestDevMemInfo.VoidPtrConstructor
19/35 Test #19: TestDevMemInfo.VoidPtrConstructor .........................   Passed    0.25 sec
      Start 20: TestDevMemInfo.MakeNewBuffer
20/35 Test #20: TestDevMemInfo.MakeNewBuffer ..............................   Passed    0.25 sec
      Start 21: TestFileInOut.RoundTripCSV
21/35 Test #21: TestFileInOut.RoundTripCSV ................................   Passed    2.67 sec
      Start 22: TestFileInOut.RoundTripJSON
22/35 Test #22: TestFileInOut.RoundTripJSON ...............................   Passed    2.69 sec
      Start 23: TestMatxUtil.ReduceMax1d
23/35 Test #23: TestMatxUtil.ReduceMax1d ..................................   Passed    0.17 sec
      Start 24: TestMatxUtil.ReduceMax2dRowMajor
24/35 Test #24: TestMatxUtil.ReduceMax2dRowMajor ..........................   Passed    0.17 sec
      Start 25: TestMatxUtil.ReduceMax2dColMajor
25/35 Test #25: TestMatxUtil.ReduceMax2dColMajor ..........................   Passed    1.40 sec
      Start 26: TestMatxUtil.Cast
26/35 Test #26: TestMatxUtil.Cast .........................................   Passed    0.16 sec
      Start 27: TestMatxUtil.Threshold
27/35 Test #27: TestMatxUtil.Threshold ....................................   Passed    0.16 sec
      Start 28: TestMatxUtil.ThresholdByRow
28/35 Test #28: TestMatxUtil.ThresholdByRow ...............................   Passed    0.19 sec
      Start 29: TestMultiSlices.Ranges
29/35 Test #29: TestMultiSlices.Ranges ....................................   Passed    1.37 sec
      Start 30: TestTensor.UtilsShapeString
30/35 Test #30: TestTensor.UtilsShapeString ...............................   Passed    0.06 sec
      Start 31: TestTensor.GetElementStride
31/35 Test #31: TestTensor.GetElementStride ...............................   Passed    0.06 sec
      Start 32: TestTensor.AsType
32/35 Test #32: TestTensor.AsType .........................................   Passed    0.16 sec
      Start 33: TestTensor.Create
33/35 Test #33: TestTensor.Create .........................................   Passed    0.16 sec
      Start 34: TestTensor.UtilsValidateShapeAndStride
34/35 Test #34: TestTensor.UtilsValidateShapeAndStride ....................   Passed    0.16 sec
      Start 35: TestTypeUtils.DTypeCopy
35/35 Test #35: TestTypeUtils.DTypeCopy ...................................   Passed    0.06 sec

100% tests passed, 0 tests failed out of 35

Total Test time (real) =  19.91 sec
```

Authors:
  - Christopher Harris (https://github.com/cwharris)

Approvers:
  - David Gardner (https://github.com/dagardner-nv)

URL: #1095
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants