The probabilistic inference model has been widely used in various areas, such as error-control coding, machine learning, speech recognition, artificial intelligence, and statistics. In this paper, we study both computation and communications power consumption of optical-based and electronic-based implementations of the probabilistic inference algorithm used in solving large scale problems. Our analysis indicates that the optical implementation provides substantial reduction for power and area compare to the electronic-based solutions as problems become large. For a network with 1 million nodes and 100 alphabet size, our proposed wavelength multiplexed all-optical implementation requires approximately 200 kilowatts (kW) of power as compared with 1.47 gigawatts (GW) and 1.7 megawatts (MW) using CPU-based and subthreshold VLSI-based systems, respectively. The optical-based solution is tolerant to shot noise and imperfections of optical modules used in the architecture as well. We also performed an all-optical experimental verification of a graphical inference as the proof of concept and have demonstrated the essential mathematical operations, multiplication, and normalization (division), in photonics operations using nonlinear bulk materials. The normalization and multiplication are shown optically through a pump-probe saturation process and a logarithm-summation-exponential (log-sum-exp) operation, respectively. We used single mode silicon waveguide and single-wall carbon nanotube (SWCNT) as nonlinear optical materials to implement logarithm and exponential operations, respectively. The SWCNT is also used as the nonlinear component in the pump-probe saturation experiment to implement the normalization function.