@@ -556,12 +556,80 @@ tensor([[[100.5474, 100.9653],
556556 [100.3148, 100.3607]]], dtype=torch.float64)
557557` ` `
558558
559+ # # Command-Line Arguments to Influence DAPHNE Behavior
560+ DAPHNE provides a range of command-line arguments that allow users to control its behavior and customize execution settings.
561+ These arguments can also be passed from DaphneLib.
562+
563+ * Example Array Format:*
564+
565+ ` ` ` python
566+ from daphne.context.daphne_context import DaphneContext
567+ import numpy as np
568+
569+ m1 = np.array([1, 2, 3])
570+ dc = DaphneContext ()
571+ X = dc.from_numpy(m1)
572+ X.print ().compute(daphne_args=[" --explain" , " parsing_simplified, parsing" , " --timing" ])
573+ ` ` `
574+
575+ * Example String Format:*
576+
577+ ` ` ` python
578+ from daphne.context.daphne_context import DaphneContext
579+ import numpy as np
580+
581+ m1 = np.array([1, 2, 3])
582+ dc = DaphneContext ()
583+ X = dc.from_numpy(m1)
584+ X.print ().compute(daphne_args=" --explain=parsing_simplified,parsing --timing" )
585+ ` ` `
586+
587+ * Output (memory addresses may vary):*
588+
589+ ` ` `
590+ IR after parsing:
591+ module {
592+ func.func @main () {
593+ %0 = " daphne.constant" () {value = 0 : si64} : () -> si64
594+ %1 = " daphne.constant" () {value = 43781056 : si64} : () -> si64
595+ %2 = " daphne.constant" () {value = 3 : si64} : () -> si64
596+ %3 = " daphne.constant" () {value = 1 : si64} : () -> si64
597+ %4 = " daphne.constant" () {value = 2 : si64} : () -> si64
598+ %5 = " daphne.cast" (%0) : (si64) -> ui32
599+ %6 = " daphne.cast" (%1) : (si64) -> ui32
600+ %7 = " daphne.receiveFromNumpy" (%5, %6, %2, %3) : (ui32, ui32, si64, si64) -> ! daphne.Matrix< ? x? xsi64>
601+ %8 = " daphne.constant" () {value = true} : () -> i1
602+ %9 = " daphne.constant" () {value = false} : () -> i1
603+ " daphne.print" (%7, %8, %9) : (! daphne.Matrix< ? x? xsi64> , i1, i1) -> ()
604+ " daphne.return" () : () -> ()
605+ }
606+ }
607+ IR after parsing and some simplifications:
608+ module {
609+ func.func @main () {
610+ %0 = " daphne.constant" () {value = 43781056 : ui32} : () -> ui32
611+ %1 = " daphne.constant" () {value = 0 : ui32} : () -> ui32
612+ %2 = " daphne.constant" () {value = false} : () -> i1
613+ %3 = " daphne.constant" () {value = true} : () -> i1
614+ %4 = " daphne.constant" () {value = 3 : si64} : () -> si64
615+ %5 = " daphne.constant" () {value = 1 : si64} : () -> si64
616+ %6 = " daphne.receiveFromNumpy" (%1, %0, %4, %5) : (ui32, ui32, si64, si64) -> ! daphne.Matrix< ? x? xsi64>
617+ " daphne.print" (%6, %3, %2) : (! daphne.Matrix< ? x? xsi64> , i1, i1) -> ()
618+ " daphne.return" () : () -> ()
619+ }
620+ }
621+ DenseMatrix(3x1, int64_t)
622+ 1
623+ 2
624+ 3
625+ {" startup_seconds" : 0.0238036, " parsing_seconds" : 0.00178526, " compilation_seconds" : 0.0734249, " execution_seconds" : 0.0232295, " total_seconds" : 0.122243}
626+ ` ` `
627+
559628# # Known Limitations
560629
561630DaphneLib is still in an early development stage.
562631Thus, there are a few limitations that users should be aware of.
563632We plan to fix all of these limitations in the future.
564633
565- - Using DAPHNE' s command-line arguments to influence its behavior is not supported yet.
566634- Some DaphneDSL built-in functions are not represented by DaphneLib methods yet.
567635- High-level primitives for integrated data analysis pipelines, which are implemented in DaphneDSL, cannot be called from DaphneLib yet.
0 commit comments